Forums

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

Changing issue transition with script runner

Rafiq Nasrallah May 30, 2023

Hello,

 

I am currently writing a script in script runner using the REST API.

 

The feature that i am implementing requires me to change the status of an issue. 

 

Currently, the code looks like this:

 

def result = put("rest/api/3/issue/<My Issue>/transitions") 
.header('Content-Type', 'application/json')
.body([
transition: [
id: '61'
]
])
.asString()

When running the script, i get:

Method Not Allowed

 

I know that ID 61 is for me a valid status.

 

Any idea on what could be the problem?

 

Thank you and have a nice day!

1 answer

1 accepted

0 votes
Answer accepted
Rafiq Nasrallah May 30, 2023

Using post instead of put worked and changed the status. However i did not understand why?

 

As far as i know, put updates and post adds new entries. Here i am only interested in updating the issue

Rafiq Nasrallah May 30, 2023

After reading more, i understood that what i knew was completely wrong. I now understand why i have to use POST and not PUT.

Thanks and have a nice day!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events