Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the JIRA REST API support querying a list of labels?

I see the is the ability to get all components of a project by doing

/project/[projectkey]/components

but I don't see any capability or documentation on how to get the list of labels that are available for a project (something like:

/project/[projectkey]/labels

Does the JIRA REST API support querying the list of labels available on a project?

like image 962
leora Avatar asked Oct 20 '25 14:10

leora


1 Answers

Jira Cloud has /rest/api/3/label.

Jira Server provides /rest/api/2/jql/autocompletedata/suggestions?fieldName=labels which is however not paginated and only returns the first few labels (label values can be queried using &fieldValue=X).

However, as hacky workaround you can misuse the API endpoints some Atlassian Jira Gadgets are communicating with. Though this has the following disadvantages:

  • Are internal APIs
  • Atlassian apparently plans to replace Gadgets with Dashboard Items eventually
  • Might change behavior, see e.g. JRASERVER-67446
  • No pagination (?), responses can be huge
  • Responses are designed for Gadgets, therefore contain irrelevant data

Labels Gadget

/rest/gadget/1.0/labels/gadget/project-<PROJECT_ID>/labels
Where <PROJECT_ID> is the numeric ID of the project.

Heat Map Gadget

/rest/gadget/1.0/heatmap/generate?projectOrFilterId=<PROJECT_OR_FILTER>&statType=labels
Where <PROJECT_OR_FILTER> can be either:

  • project-<PROJECT_ID>
  • filter-<FILTER_ID>
like image 175
Marcono1234 Avatar answered Oct 25 '25 07:10

Marcono1234



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!