0

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();
}
lakshayg
  • 2,053
  • 2
  • 20
  • 34
Rish
  • 447
  • 7
  • 24

1 Answers1

1

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?

mdoar
  • 6,758
  • 1
  • 21
  • 20
  • Yes I a using a plugin from where I have to use these classes . – Rish Jul 11 '12 at 07:53
  • I have found the following code : (Pasted in the question ) But did not find where does it convert to JSON format .. I have also found a comment above this code : "@response.representation.200.doc * Returns a full representation of a JIRA issue in JSON format." – Rish Jul 11 '12 at 10:07