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

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?

1 answer

1 votes

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 Levy Community Champion Dec 06, 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

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.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,739 views 11 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot