Forums

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

Unable to add/set label on Already created issue via edit REST API

I am using this with a curl command but every time i get same response for priority , components and labels.

curl -u username:password -X PUT --data @Data.json -H "Content-Type: application/json" https://<SERVER>/rest/api/2/issue/<issueKey>

below is my data.json File

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

 

Response:

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

1 answer

1 vote
Nic Brough -Adaptavist-
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.
June 6, 2020

I'm afraid we can't tell you much more than the error message does.  You are trying to edit an issue, setting a field that is not editable because it is noton the edit screen.

There are actually two possible problems here

1) the field is no enabled for edit, because it is not set to be an editable field

2) the account you are using does not have the rights to edit the issue.

Thanks @Nic Brough -Adaptavist-  for your response.

The field is editable from the UI. (Or is there any alternate way for how to check the field is editable or not.)

My acount has Edit permissions, thats why i am able to edit the issue from UI.

Nic Brough -Adaptavist-
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.
June 7, 2020

To check if the field is editable, go to an issue and click "edit" and check if the field is shown and that you can update it there.

If the field is editable, then the other thing that causes this problem is that the user you have logged in as does not have edit.  This error message can happen when you have failed to authenticate as well.

@Nic Brough -Adaptavist-  as I mentioned before, from the UI these fields are available. but not from the update API.

Nic Brough -Adaptavist-
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.
June 8, 2020

Then it's your authentication

But with the same authentication method, I use create a log, update transition, attachment, and assign API  all are working fine.

Luke Miranda
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!
November 4, 2021

You aren't crazy @Azaz-Ur-Rehman 3173-FBAS_BSCS_F15 , this is an issue on Atlassian's side but sadly the solution is marked as "Won't do"

https://jira.atlassian.com/browse/JRASERVER-27936
https://jira.atlassian.com/browse/JRASERVER-27929

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events