Hi everybody,
I tried to change a status using scriptrunner and Post API... But return error.
My script is as
// }
def result2 = post("/rest/api/3/issue/${issue.key}/transitions")
.header('Content-Type', 'application/json')
.body(
transition: [
"id": newStatusId
]
)
.asString()
But It doesnt work.
Hi Rogerio,
I can confirm we have an example in the documentation here that shows how to transition an issue.
I can confirm I have tested this, and it works as expected as long as the transition Id specified is a valid transition in the workflow that could be made through the UI, as only valid transitions that users can make in the UI can be done via a script as well.
I hope this helps.
Regards,
Kristian
Hi Kristian,
How are you? Thank you for your help.
I did a adjustment but It doesn't work. Returned to me.
Do you have idea?
I am administrator in the project. So, I don't understand it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rogerio,
This error indicates that there are some required fields or there are some validators that control who can handle the issue.
The API will only allow the issue to be transitioned if all required fields have values and if the script user has permission to transition the issue.
If the issue cannot be transitioned in the UI, then it will not be able to be transitioned by the Script, so you should ensure the problem can be transitioned in the UI first before using the script.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.