Changing maxResults parameter for Jira Cloud REST API

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

Symptoms

Jira Cloud REST API endpoints return a limited number of results, which can be different than the value passed for the maxResults field in the request.

For example, when posting a request to /rest/api/2/search with the following POST body:

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

The total issues returned will be limited to the number provided in maxResults field of the response, which may be lower than maxResults of 1000 sent in your request

Cause

Limits on the response size for resources that return large collections of items improve performance for all JIRA Cloud users. Each API endpoint may have a different limit for the number of items returned. As a consequence, the maxResults in the request is overridden if it is above the limit defined for given REST API endpoint.

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

Last modified on Nov 28, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.