How to obtain a list of existing labels via rest api

i would like to query for issues by label - therefor i need to know which labels exist in a project or a result-set, or in the entire jira instance. but unfortunately i cannot find a rest service. any idea?

Hello @florian,

Unfortunately, I don’t think there’s a publicly available REST API to return all the possible labels. After some digging, the closest I came up with is /rest/api/1.0/labels/suggest?query - do note that I kept query query parameter to not have a value so it will return all. The downside is that this only works in the browser, I tried via command line + basic auth and it does not return anything but it works in the browser. I have not tried accessing it in a connect app though, you might want to give it a shot and if you do, please tell us how it goes.

A bit of backstory, I found /rest/api/1.0/labels/suggest?query as part of the labels field being returned by calling Get create issue metadata and expanding projects.issuetypes.fields with the hopes that it shows all possible values for labels given a specific project ID or key (it shows possible values of other fields though).

Cheers,
ian

Digging some more, I found an existing improvement request for this feature (see [ACJIRA-788] - Ecosystem Jira). Also, all of these are under the assumption that you’re targeting Jira cloud.

Hope this helps!
Ian

thank you @ianRagudo
yes i also found /rest/api/1.0/labels/suggest?query but unfortunately it is not available if called from AP.request (jira cloud fronted).

well i am watching the improvement request and hope for a solution in the future as i guess there are many use cases where a list of available labes are necessary!

thx again :wink:

2 Likes