how to alter the number of maxResults on a /search?jql REST API call to Jira Cloud

Deleted user December 6, 2017

The default return of a search call to my Jira Cloud always returns a paginated response with a maxResult of 50. Since I'm developing a call to be treated by a javascript function, I'd like change it to 1000 or 10000 so I can ensure I get all the results with no truncated data.

 

My call is:

 

/rest/api/2/search?jql=project%3D%22<project-name>%22&fields%3D...

 

The return is

"expand": "schema,names",
"startAt": 0,
"maxResults": 50,
"total": 237,
"issues": [

 

Is there a parameter I can pass so the returned maxResults is at least equal to the total.

 

Can it be done? How?

2 answers

2 accepted

3 votes
Answer accepted
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 6, 2017

Hi Gustavo,

In the past you used to be able to send the maxResults parameter in the API call and change the number of requests you get back but I have not been able to do this in some time.

Recently a knowledge base article came out titled Changing maxResults parameter for Jira Cloud REST API that may be of assistance:

Resolution

Refer to maxResults limit for the given API that is provided in the returned JSON object, and rely on pagination to retrieve the desired number of results in chunks. Since maxResults limits may change over time and vary for different API resources, we recommend that REST API clients programmatically confirm maxResults value when making the request.

Example:

{"jql": "project = PROJ ORDER BY key ASC","startAt":0,"maxResults":50,"fields":["id","key","summary","status.id","issuetype","timeoriginalestimate","timeestimate"]}
{"jql": "project = PROJ ORDER BY key ASC","startAt":50,"maxResults":50,"fields":["id","key","summary","status.id","issuetype","timeoriginalestimate","timeestimate"]}

Other Info

According to the Atlassian REST API policy, the default and maximum sizes of paged data are not considered part of the API and may change without notice.

maxResults limits set for any individual Jira Cloud REST API may not be applicable to other API endpoints and are not guaranteed to remain unchanged

Cheers,

Branden

Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2017

You may also want to scroll through this from a few months ago

https://community.atlassian.com/t5/Jira-discussions/Jira-max-results-is-100/m-p/642338#M1137

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 6, 2017

I would also recommend just reading the Status Update in the description of https://jira.atlassian.com/browse/JRACLOUD-67570 

Jira Cloud Product Manager, Eve, explains why this change was made and what steps can be taken in order to work around this change in behavior to the REST API.

Previously there was a 1000 record limit, but this has been reduced to 100.   To work around this we recommend the use of pagination as described in the KB article Branden cited.

0 votes
Answer accepted
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2020

Hello Folks,

Additionally to the information above, we created a feature request to properly increase the limit for the MaxResults parameter in REST API:

JIRA Cloud REST API increase the limit for maxResults 

Feel free to vote and watch the suggestion to increase its priority and also receive notifications about any updates.

Kamran786 August 10, 2020

@Petter Gonçalves 

Good Morning

i am using postman to retrieve my issues for one of the project but since maxResult is set to 100 so i am not able to retrieve all my issues. Currently i have 12k + issues which i want to retrieve it to perform some operations. 

Kindly suggest me best approach in order to fix it.

And your above given link is not opening. i tried but unfortunately its giving error.

Like Jordan Bauman likes this
Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 10, 2020

Hi @Kamran786 

The only way that I can think of for you to get 12k+ issues is to run the API from some code (i.e. mimic what Postman is doing but via code). It is obviously not practical to run the API in Postman 120+ times, changing the startAt parameter each time. 

The link above had an extra http in front of it, try this instead

Like Robert Cotman likes this
Kamran786 August 10, 2020

@Warren 

Thank you for your suggestion.

One more thing want to check is there any way i can pull all the issues into an excel sheet.

1. Without using any plugin

2. If plugin needs to be used then which one will be more effective and powerful.

3. And does the plugin requires any additional amount and can i be free.

Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 10, 2020

Hi @Kamran786 

There is a way to export 1000 issues at a time to Excel CSV, so it would mean exporting 12+ sets of data, which is far better than 120+ in Postman.

Follow the steps on this page to export them all

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events