How do I get a list of labels for a Jira server with C#?
I can get a list of projects with
a list of components for a project with:
Is there an API to get a list of labels? Per project or global?
That's known as Scope Creep - your question said either per project or global, I give you global but you actually want per project ;-)
Seriously, no I can't see a way to limit it to a project, the only parameters it takes is startAt and maxResults
Hi @Pete Goodwin ,
However, once you can see the names of these labels, you can put these into a JQL search via REST for each label name to the endpoint GET /rest/api/2/search.
I do not have a working example in C# but in theory, as an example, a call formatted something like the following, where this will return all the issues that use a specific label and then order the results by their project. From there you could then take that data to match out the project value per issue or the issue key of the issues returned to see which projects are using this:
GET /rest/api/2/search?jql='labels in (label1,label2,label3,.....etc) order by project desc'
OR the following which would isolate to the specified project, and return any issues with labels in use from your list of all labels, which could then be grouped to show unique labels for your list per project in yor script.
GET /rest/api/2/search?jql='labels in (label1,label2,label3,.....etc) AND project = EXE'
Hope this helps
Hi @Pete Goodwin ,
Long URL's can hit memory issues in the browser but I do not believe you would run into any limitation in the API and would allow for much longer input strings. The only downside is that manual input would be unmanageable as the labels can be added in ad-hoc so constant watching for updates would be needed. Going this route I would suggest looking into a method to script the input values into the second query from the first.
Hey there Cloud Community members! We’re excited to give you the first glimpse of the new home for business teams on Jira — Jira Work Management. Jira Work Management is the next generation of J...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events