Why can't I add labels to an issue via the REST API?

Whenever I try to create labels for a new issue (either when I'm creating it or after it's been created) I receive a 400 Bad Request response from the server and the following body:

{
    "errorMessages": [],
    "errors": {
        "labels": "Field 'labels' cannot be set. It is not on the appropriate screen, or unknown."
    }
}

Here's an example of how I'm attempting to add the label with a PUT request:

{ 
	"update": {
    "labels": [ {"add": "automated"} ]
	}
}

Again, I'm able to create issues just fine - and the labels field is displayed when attempting to create an issue through JIRA normally, so I'm sort of at a loss for why this could be happening.

2 answers

0 vote

Can you provide any more information? I am not having the same issue when I try the above string as the JSON request.

0 vote
Boris Berenberg Community Champion Apr 22, 2015

Try creating the issue via the UI with the user which is being used to auth. "Field 'labels' cannot be set. It is not on the appropriate screen, or unknown." is a pretty clear error, and you need to address why the user essentially does not see the field.

I agree that it is a clear error, but when I try to create the issue from the UI the labels field is clearly visible. I've attached a screenshot. This is the same user, same project, etc. If I send a GET request to the issue/createmeta and expand the fields for this project, I also see labels as valid. However, when I send the request either alongside the rest of the data to create the issue or update it after creation, I receive the above error. Can you think of anything else I should check?

labelcap.png

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,319 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot