How to use the maxResults API parameter for Jira Issue Search REST API

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This article explains how to use the maxResults parameter in the Jira Issue Search REST API. The maxResults parameter is a query parameter used to limit the number of items returned in a Jira REST API response, and it is used to control pagination when retrieving large amounts of data. The article provides an example of how to use the max-results parameter to retrieve issues from Jira using JQL. It also highlights the importance of setting a reasonable value for maxResults to avoid slow response times and high server load.

Environment

Jira Server and Jira Data Center

(While Jira Cloud has this parameter, there are other restrictions in place in Cloud that can limit its effective use, see JRACLOUD-67722 - Getting issue details... STATUS )

Solution

By default, the Jira Issue Search REST API returns a maximum of 50 items per response. If you want to retrieve more items, you can use the maxResults parameter to increase the limit.

How to use maxResults in Jira Server and Jira Data Center

To use the maxResults parameter in Jira, you need to append it to the end of the REST API endpoint URL, as shown in the example below:

http://jira.example.com/rest/api/2/search?jql=project%3DITSM&maxResults=50

In this example, we are using the /search endpoint to retrieve a list of issues from the ITSM project, and we have set the maxResults parameter to 50. This means that the Jira REST API will return a maximum of 50 issues per project.

To access all of the Jira APIs, you can refer to the documentation provided at https://docs.atlassian.com/software/jira/docs/api/REST/latest/



Last modified on Sep 11, 2024

Was this helpful?

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