Not able to add/update JIRA labels via REST API

Amine Rouh January 12, 2022

Hi

Im not able to add labels to JIRA tickets through REST API ( trying with Postman)

 

PUT request to https://mydomain.atlassian.net/rest/api/3/issue/{ID} :

`

{
       "fields": {
               "labels": [
                         "Testing",
                         "Automation"
              ] 
        }
}

`

 

I also tried the update syntax and getting the same error :

 

`

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

`

I receive the famous error : 

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

Please note : 
- I can see Labels on both creation screens and when I check any ticket
- My authorizations are correct
- I tried both API V3 and V2 
- Same code worked a couple of months ago without any issue, and no admin is aware of any changes or restrictions.

2 answers

0 votes
Amine Rouh January 13, 2022

For anyone who tried all the possible approaches above, I know why it's happening. Basically, it comes to the field configuration in JIRA,
https://github.com/pycontribs/jira/issues/16#issuecomment-71475148 

A simple test :
 - User 1, creates a ticket in JIRA, using postman or your script try to add/edit labels with the User 1 credentials => Works. 
 - User 1, creates a ticket in JIRA, using postman or your script try to add/edit labels with the User 2 credentials => It will give the error mentioned above. Only the owner can edit via REST API the labels. 

 

Looking for any documentation on how to resolve this from the project configuration 

0 votes
Amine Rouh January 13, 2022

Based on this post   I check my Edit screen and I see the labels. so I'm out of leads on how to resolve this.

 

Screen Shot 2022-01-13 at 11.37.46 AM.png

Suggest an answer

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

Atlassian Community Events