How to set jira resolution state?

UJJWAL PHOPATE
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!
January 16, 2020

Hi ,

I am trying to set the resolution state on jira by the url :  "/rest/api/2/issue/${issueOrkey}/transitions"

and the json body=

{

"fields": {
"resolution": {
"name": "Duplicate"
}
},
"transition": {

"id": "100"

}
}

 

It is not working as getting 500 error or sometimes 405 also,

please help with this issue where I am doing wrong either url or parameter 

I did not get api related to resolution  on jira docs so trying with "transition "  url.

Thanks in advance

2 answers

0 votes
Nivaldo Georg Junior February 23, 2022

Hi everyone,

I've get to the result using the following solution:

A Resolution Screen.
(containing only the "Resolution" field)


A Custom Workflow.
(With all the statuses that must transition to resolve an issue containing a transition with the Resolution Screen created above) 

The Resolution Screen is inside the transition named: "Resolve Issue"

With that in place, use the following URL:

https://<your_instance_url>/rest/api/2/issue/{issue_key}/transitions?expand=transitions.fields&transitionId={transition_id}


With this payload: 


resolution_name = "Duplicate"
transition_id = "41"

{
 "update": {},
 "transition": {
    "id": transition_id # the id must be a string
  },
  "fields": {
    "resolution": {
      "name": resolution_name
   }
 }
}


Considering resolution_name as "Duplicate"

Remember to add your transitions containing screens, that should work out fine.

0 votes
Krister Broman _Advania_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2020

First of all you are doing a POST command right? Since that API link is the same for both POST and GET which will get you very different results. 

When you run the GET command what is your result?  

UJJWAL PHOPATE
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!
January 16, 2020

{"expand":"transitions","transitions":[{"id":"61","name":"Reopen issue","to":{"self":"URL/rest/api/2/status/1","description":"The issue is open and ready for the assignee to start work on it.","iconUrl":"URL/images/icons/statuses/open.png","name":"Open","id":"1","statusCategory":{"self":"https://URL/rest/api/2/statuscategory/2","id":2,"key":"new","colorName":"blue-gray","name":"To Do"}}}]}

Krister Broman _Advania_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2020

And there's your answer, that specific issue have only one transition available and that has ID:61, not 100..

If this is not the transition that you desire then you need to go in to the issue and/or project and set the correct permissions and fill out the correct data. 

Like UJJWAL PHOPATE likes this

Suggest an answer

Log in or Sign up to answer