Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Get Issue from BasicIssue in Jira

Umang Kedia February 6, 2013

I am retrieving data from JIRA using Jira Java Rest Client(JRJC). For a JQL search, I get a List ofBasicIssue. See the API for reference

I want to get the list of Issue from the JQL result. A BasicIssue is different from Issue. See theAPI

The following operation which retrieves issue by using Issue key is very costly and takes much time.

issueClient.getIssue(BasicIssue.getKey(),npm)

npm is ProgressManager and issueClient is the IssueRestClient

Please suggest a better method for getting Issue from JQL result.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Aleksander Mierzwicki
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2013

You can use the JRJC 2.0 version (which is not yet released, nor stable, and I can't yet say when it will be released, but we're releasing milestone versions that works quite well). The latest version is 2.0.0-m7. Using the new version you can get issues using the same SearchRestClient#searchJql method (it now returns rich Issue).

For the 1.x versions there is no better way than just get a list of basic issues and then retrieve details using IssueRestClient#getIssue.

In the 2.0 version we've changed the implementation to be asynchronous. This means that each method in JRJC now returns Promise, on which you have to call .claim() to get the result. Worth to mention is that when your'e done using JRJC it need to be cleanup now (to shoutdown threads) - it can be done by calling restClient.destroy().

Umang Kedia February 8, 2013

Can you give me the link for milestone 7. I can find only m2 on this link https://maven.atlassian.com/public/com/atlassian/jira/jira-rest-java-client/

Umang Kedia February 10, 2013

I am not talking about the plugin development. In Rest Client api there is only 2.0.0 m2 jar

Aleksander Mierzwicki
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2013
Umang Kedia February 11, 2013

I don't think thats the java client I need. On this link m2 is there. https://maven.atlassian.com/public/com/atlassian/jira/jira-rest-java-client/

I can't even find the dependecy for JiraRestClient in the jar you provided

Umang Kedia February 11, 2013

In the Jira Rest core api docs I couldn't find all the classes. Do we need any other jar also besided jira rest client core

http://docs.atlassian.com/jira-rest-java-client-core/2.0.0-m7/jira-rest-java-client-core/apidocs/

0 votes
Vishal July 7, 2017

I was able to successfully retrieve data with com.atlassian.util.concurrent.Promise and com.atlassian.jira.rest.client.api.JiraRestClient:

JiraRestClient restClient = new AsynchronousJiraRestClientFactory().createWithBasicHttpAuthentication(yourJiraServerURI, "yourUsername", "yourPassword");

Promise issuePromise = restClient.getIssueClient().getIssue(issueKey);

 

pom.xml:

        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-java-client-core</artifactId>
            <version>3.0.0</version>
        </dependency>    
   <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-java-client-api</artifactId>
            <version>3.0.0</version>
        </dependency>

TAGS
AUG Leaders

Atlassian Community Events