Get all Jira Issues for a specified Project

Shereen Hussein picture Shereen Hussein · Jul 7, 2013 · Viewed 24k times · Source

I am using Jira REST API to get all the Issues in Jira for a specific Project. I don't want to have maxResults=50, which is the default. I just want to retrieve all issues for the project. Here is my command:

{ my $result = `curl -D- -u $usernameData:$passwordData -X GET -H "Content-Type: application/json" "http://jira.alm.mentorg.com:8080/rest/api/2/search?jql=project=HDS&maxResults=1000&fields=summary"`;}

I set maxResults=1000 and if I remove it, it will be set by default to 50! I just want to get all the Issues without having to worry about the maxResults. Can anyone help me with that?

Answer

Neo picture Neo · Aug 21, 2013
  1. Set the maxResults to a ridiculously high value e.g. 5000
  2. Make an extra call just to fetch the total records quickly, without actually fetching any content

    http://jira.alm.mentorg.com:8080/rest/api/2/search?jql=project=HDS&maxResults=0