Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Java REST API: Get more than 1000 Issues

georgiossalon
Contributor
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
Contributor
January 2, 2019 edited

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 Champion
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
Contributor
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
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events