Getting List of issues through JIRA-REST Client in Java

Hi All,

I and quite new to JIRA and am working on extracting issue information from JIRA through REST Client.

Dev Environment

I am using eclipse IDE and a maven project.

I was able to retrieve issue information one by one using REST Client.

Now I am trying to get all the issues which match a filter and put it in an array.

I went through already raised requests and posts in this forum. But those are using Searchrequests and searchservice API's which are quite old and replaced with SearchRestClient I assume.

I am aiming to get all issues and put into a list.

If anyone has done it, please let me know. 

Thanks in advance.

2 answers

1 accepted

For those who come across this Here is the answer

 Set<String> myFields = new HashSet<String>();

myFields.add(custom fields);

etc

Promise<SearchResult> searchJqlPromise = client.getSearchClient().searchJql(jqlForDataEnrichment, 1000, 0,
myFields);

 

//iterate now.

for (Issue issue : searchJqlPromise.claim().getIssues()) {

 System.out.println("Key: " + issue.getKey());

etc

}

 

I got a solution now. However the number of records being retrieved is only 50 whereas manual execution of JQL returns me 550 records.
Any idea how to override default size to get all records.

Code

Promise<SearchResult> searchJqlPromise = client.getSearchClient().searchJql(jqlForDataEnrichment);

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published yesterday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

451 views 6 7
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you