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 vote

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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

118 views 0 5
Read article

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