1

I am sending the below PUT request to JIRA and unable to update the ticket. I am receiving 200 Http Status code with the ticket details JSON in response. However, this doesn't include the updated labels.

curl --location --request PUT 'https://jiraserverurl/rest/api/2/issue/APP-1' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer XXXX' \
  --data-raw '{
     "update": {
       "labels": [
          {
           "add" : "newlabel"
          }
       ]
     }
   }'

I referred to this article Failure in updating Atlassian Jira label using REST API and did everything in a same way. However, it still doesn't update.

Unfortunately, I am receiving 200 Success response. Therefore, no clue of why it is not working!!

Uma Ilango
  • 968
  • 4
  • 16
  • 31

1 Answers1

1

You are almost there; just change --data-raw to --data (or -d) and try body in same line:

curl --location --request PUT 'https://jiraserverurl/rest/api/2/issue/APP-1' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer XXXX' \
  --data '{ "update": { "labels": [{ "add" : "newlabel"}]}}'
stuck
  • 1,477
  • 2
  • 14
  • 30
  • I am using Postman. I got it as --data-raw in Postman cURL. Is there any other way to make it work in Postman? – Uma Ilango Jun 23 '22 at 13:31