The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Can't set priority when creating an issue REST API

JacobZielinski
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!
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Mohamed Benziane
Community Champion
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
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!
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
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!
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
TAGS
AUG Leaders

Atlassian Community Events