Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do you find issues by label?

Stanislav Peck March 7, 2018

I'm using the JIRA REST API as part of a microservice. I want to be able to pull stories from a board that share a certain label and return them as a list. I can find issues by number, but the returned value doesn't have label data, and I can't find anything that mentions labels in the API.

I found this question, which has an answer, but I can't resolve the link and don't have the REST API browser (which I assume is what the link is for).

My service is running Node.js with the npm jira-client package.

1 answer

1 accepted

1 vote
Answer accepted
Craig Castle-Mead
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.
March 7, 2018

Hey Stanislav,

Searching by label (code below assumes the label you want is "labelname" - change accordingly, you can use https://jira.company.com/rest/api/2/search?jql=labels%20IN%20(%22labelname%22)

The below is returning the labels for a jira issue PROJECTKEY-123 (if you remove the fields=labels, you get all the fields but it takes a bit longer

https://jira.company.com/rest/api/2/issue/PROJECTKEY-123?fields=labels

Tested on Jira server 7.6.2

Hopefully this helps, but if not, let us know

CCM

Stanislav Peck March 8, 2018

Thank you, Craig!

That's definitely steering me in the right direction. I neglected to mention that I'm trying to do this programatically from my service in javascript using the npm jira-client package.

I did find this, which I think might be more along the lines of what I'm looking for, if it works the way I think it will. I'll report back.

Stanislav Peck March 13, 2018

The command I was using was building the URI incorrectly. Thanks for helping me to suss that out!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events