How to get all issueKeys in a jira project by rest api?

Ronaldo Huang January 12, 2021

I have a jira projectKey,and I want to get all issueKeys by rest api.

1 answer

1 accepted

1 vote
Answer accepted
Daniel Wong
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 12, 2021

Hi Ronaldo,

I'm going to quote an answer (with a bit of updates to direct at this question) from a previous answerer as that person has given a very good description and brief guide on how to use Jira's REST API:

  1.  Get the total issues in a project with a basic and 'quick and light' query
    1. URL: https://<server>/rest/api/2/search?jql=project=<YourProjectKey>
    2. This gives a result like --> 
      { "startAt": 0,
        "maxResults": 50,
        "total": 24,
        "issues": [...] }
  2. Iterate over the total number of issues to fetch the desired details/fields of each issue.
    1. Note: Maximum allowable fetch seems to be 1000 issues at a time.
    2. We can also filter the fields that we are interested to fetch. Since you are only interested in key, we will filter fields shown to just key.
    3. search on URL: "https://<server>/rest/api/2/search?jql=project=<YourProjectKey>&fields=key"

I highly suggest reading the previous answerer's post as it will give you more context and has some other useful tips to handle projects with > 1000 issues - sayeed1310's answer

Suggest an answer

Log in or Sign up to answer