Forums

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

How to get all issues using Jira Rest Java Client

Andrei Iorga September 30, 2020

Hello, I am trying to get all issues from a project using Jira Rest Java Client using the following code: 

Iterable<Issue> issues = client.getSearchClient().searchJql("project = MYPURRJECT AND status in (Closed, Completed, Resolved) ORDER BY ssignee,resolutiondate").claim().getIssues();

However it only return a list of 50 issues (I have over 8000 in the project). I guess that it returns 50 because this is the size of a page in jira. Do you have any idea how can I specify that I want all of them?

The code that I am using is inspired by this link: https://pastebin.com/WUMZ0vZa

1 answer

1 accepted

1 vote
Answer accepted
Ankit Dahiya
Contributor
September 30, 2020

https://bitbucket.org/atlassian/jira-rest-java-client/src/master/api/src/main/java/com/atlassian/jira/rest/client/api/SearchRestClient.java

-> 

Promise<SearchResult> searchJql(@Nullable String jql, @Nullable Integer maxResults, @Nullable Integer startAt, @Nullable Set<String> fields);

 

Currently you only have the jql defined in the call, use the startAt and maxResults to get required data.

Andrei Iorga October 2, 2020

Thank you very much

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events