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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

125 views 4 5
Read article

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