Can't set priority when creating an issue REST API

JacobZielinski September 30, 2019

HI, I'm using Post to creat a issue and no matter what priority ID I use , issue always comes with default 'Major' priority.

I've checked, and on create through an app it allows me to set priority.

I have alos confirmed that ID i use are indeed the correct ones.

 

{
"fields": {

"project":
{
"key": "<key>"
},

"summary": "Test asign to issue custom reporter",
"description": "TEST TEST TEST",
"issuetype": {
"name": "Feature"
},

"assignee":{
"name": "Me"
}

},
"priority":{
"name": "Minor",
"id": "4"
}

}

Response:

 

{ 
"id": "<number>",
"key": "<key>",
"self": "https://<name>.atlassian.net/rest/api/2/issue/<id>"
}

 

Result:

ticket.png 

1 answer

1 vote
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 30, 2019

Hello @JacobZielinski 

Can you try this:

"priority": {
            "name": "Minor"
}

Or this

"priority": {
      "id": "your priority id"
    }

 

It seems that you need to use just the id or the name not the two at the same time.

 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-issue-post

Hope this helps

JacobZielinski September 30, 2019

Hi, thanks for the answer

unfortunately no matter what it does not work.

I get response and ticket is created without any issues but it always comes with major priority.

Andrey Tetyuev March 9, 2022

The request is quite old, so I'm commenting hear just with hope that it helps someone later:

I think the root cause in original request was that the "priority" was placed outside of "fields" scope, i.e. the "fields":{...} get closed before the priority attribute being given while it's expected that "priority" attribute is a part of "fields", i.e.:

"fields":
{
...
, "priority":{...}
}

Correspondingly the previous reply doesn't help because only a part within "priority" was modified.

Ryan Cooper August 13, 2023

Also, make sure the priority system field has been added to the issue screen or it will not be settable via API calls.

Like Kirill Netreba likes this

Suggest an answer

Log in or Sign up to answer