Retrieve only issue keys from JQL

Hello,

I’m am trying to write a query (JQL) that will return only the issue key and not the whole bug.
How do I do that ?

@IlanYaniv, welcome to the Atlassian developer community. Thanks for posting.

Which operational model of Jira are you targeting? Which REST API are you trying to use?

Assuming Cloud, REST API v3, and POST for the JQL search, you can pass a body parameter for fields to add and remove what is returned. Unfortunately, you can’t slim it down to only keys. The closest I can get is:

/rest/api/3/search?jql=&fields=key

Which returns something like:

{
  "expand": "schema,names",
  "startAt": 0,
  "maxResults": 50,
  "total": 1,
  "issues": [
    {
      "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
      "id": "10928",
      "self": "https://devpartisan.atlassian.net/rest/api/3/issue/10928",
      "key": "WCNG-3"
    }
  ]
}
1 Like