Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do you use the REST API to update Priority?

Robert Hanson August 7, 2012

Here is my PUT (to the URL /rest/api/2/issue/TEST-141):

{"update":{"priority":[{"set":"Trivial"}]}}

And here is the error:

{"errorMessages":[],"errors":{"priority":"Could not find valid 'id' or 'name' in priority object."}}

I also tried using the numeric ID (5), which returns the same error.

I have no issues updating other fields like the Summary or Description using this same PUT.

Any help on getting the input corrected would be appreciated.

Thanks.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

6 votes
Answer accepted
Mike Norton August 7, 2012

I believe the PUT data should look like this:

{"update":{"priority":[{"set":{"name" : "Trivial"}}]}}

Robert Hanson August 7, 2012

Yup, that is it. Many thanks.

0 votes
mcelo March 6, 2018

Just a couple of notes:

- you must have priority set before calling PUT otherwise you'll get

{"errorMessages":["Internal server error"],"errors":{}}

- the complete curl to change priority is

curl -u user:password -X PUT --data "{\"update\":{\"priority\":[{\"set\":{\"name\":\"Low\"}}]}}" -H "Content-Type: application/json" http://yourserver/rest/api/2/issue/YOURISSUE-123

 - the complete list of your current priorities is

http://yourserver/rest/api/2/priority
TAGS
AUG Leaders

Atlassian Community Events