Java REST API: Get more than 1000 Issues

georgiossalon January 2, 2019

I am trying to analyze the processes in a project and want to get all the issues in it with Java.

 

Since the maximum amount of issues that is possible to get retrieved with a JQL is 1000 I am trying to write a loop to get them all.

 

Is there a way to get the number of issues in a project as an integer value? In the JIRA GUI, I can see this value, so it must be somewhere saved. If so I can use the Java REST API to retrieve it.

 

If not I will do it with a while-loop.

2 answers

1 accepted

1 vote
Answer accepted
georgiossalon January 2, 2019

Found the answer I was looking for.

In the 

final SearchResult searchResult = restClient.getSearchClient().searchJql(...);

searchResult variable there is a property named total, so with a 

searchResult.getTotal()

I got the value I was looking for and will use it in a Do-While Loop.

2 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 2, 2019

Hi! 

 

Yes, in the response you can see parameters, like limit, start and isLast, and total of number issues. 

You can play it by python.

e.g. 

https://github.com/atlassian-api/atlassian-python-api/blob/master/examples/jira-jql-query.py

Also, you can from your browser the result of pagination

 

hope it helps

 

Cheers,

Gonchik Tsymzhitov

georgiossalon January 2, 2019

Jap, thanks for the answer. 

 

I found a similar solution in Java though.

Nisarga.lokesh October 16, 2019

how to get more than 1000 issues through java code

Suggest an answer

Log in or Sign up to answer