Rish
Rish

Reputation: 457

Jira issues in JSON format (Need to know thw classes and functions called by I am trying to use the REST API "api/2.0.alpha1/issue/{issueKey}"

I am trying to use the REST API api/2.0.alpha1/issue/{issueKey} .

Reference: http://docs.atlassian.com/jira/REST/4.4.3/#id2413591

  1. I would get all issue id's from rest/api/2.0.alpha1/search
  2. Using these issue IDs get all issues in JSON format.

But as I am using localhost (local Machine) I do not want to make network calls and increase network traffic. Hence I wanted to know which class in JAVA does these URIs call so that I can directly call these classes to get the issues in JSON format.

Basically I want all the issues in JSON format without network calls.

OR

I also have all the issue retrieved in issues object but not in JSON format. How can I convert that into JSON format?

I have found the following code from JIRA:

@GET
@Path ("/{issueKey}")
public Response getIssue(@PathParam ("issueKey") final String issueKey)
{
    final Issue issue = getIssueObject(issueKey);
    final IssueBean bean = createIssue(issue);
    return Response.ok(bean).cacheControl(never()).build();
}

Upvotes: 0

Views: 1860

Answers (1)

mdoar
mdoar

Reputation: 6881

You could search the source code for the @GET references or use the REST API browser (https://developer.atlassian.com/display/RAB/Overview+of+the+Atlassian+REST+API+Browser) but accessing the classes from Java probably means that you need to be running in the same class loader as JIRA or using a plugin.

Have you measured the overhead of the calls to make sure that you are not optimizing prematurely?

Upvotes: 1

Related Questions