Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

jira curl to get issues when pagination

lurachen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 1, 2019
i use curl to get jira issues like this:curl -u username:password http://10.6.0.21:8080/rest/api/2/search?jql=project%20%3D%20VISION%20and%20updated%3E%3D2018-12-01%20and%20updated%3C%3D2018-12-08. The result shows there are 62 issues,but for jira has maxResultNum per page config= 50,so i use 'curl -u usename:password http://10.6.0.21:8080/rest/api/2/search?jql=project%20%3D%20VISION%20and%20updated%3E%3D2018-12-01%20and%20updated%3C%3D2018-12-08&startIndex%3D50 ' to get the 2nd page issues, bug fail. How could i get the 2nd page issues?

1 answer

1 vote
Rafael Pinto Sperafico
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.
January 1, 2019

Hi @lurachen,

When issuing the REST API endpoint, you will notice at the beginning of the response the a "startAt" property:

{"expand":"names,schema","startAt":VALUE,"maxResults":50,"total":62,"issues":

If you replace "startIndex" with "startAt" you should get the JSON response you are looking for. More information on:

Two additional URL parameters are provided in the request: startAt and maxResults. These parameters specify the starting issue returned in the JQL results and the number of issues from that starting issue respectively.

Extracted from https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events