Forums

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

How can I get label of issue

David Smejkal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 24, 2020

Is there any way to get labels of issue?

When I sent request to find specific issue by ID, I can not find label in the response. 

https://techfides.atlassian.net/rest/api/3/issue/${issueId}/worklog

 

2 answers

1 accepted

1 vote
Answer accepted
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 25, 2020

Hello @David Smejkal ,

Thanks for reaching out to the community and welcome.

Your on the right track looking at the endpoint for the issue "GET /rest/api/3/issue/{issueIdOrKey}"  but to get a specific custom field value output you need to expand on the field content as described in the link via:

fields

Array<string>

A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a subset of fields. Allowed values:

  • *all Returns all fields.
  • *navigable Returns navigable fields.
  • Any issue field, prefixed with a minus to exclude.

Examples:

  • summary,comment Returns only the summary and comments fields.
  • -description Returns all (default) fields except description.
  • *navigable,-comment Returns all navigable fields except comment.

This parameter may be specified multiple times. For example, fields=field1,field2& fields=field3.

So if you wanted to get the labels on issue ABC-123 the GET would be:

GET /rest/api/3/issue/ABC-123?fields=labels

Regards,
Earl

David Smejkal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 26, 2020

Thank you, it helped me a lot.

Like Earl McCutcheon likes this
0 votes
sugirtha chandrasekaran March 2, 2022

Hi @Earl McCutcheon ,

I tried the following end point but response returns status as 404:Although I added 2 labels and it was added successfully and is displayed in my issue.

10403 is my Issue ID.

GET: http://localhost:8080/rest/api/3/issue/10403?fields=labels

Could you please advise.

Thanks,

sugirtha chandrasekaran March 2, 2022

Tried with /rest/api/2/... and it worked. 

Suggest an answer

Log in or Sign up to answer