Unable to perform workflow transition using REST API

Please add any details that might help us help you.

After migrating the Jira SOAP API to REST, we are experiencing a problem with the workflow transitions.

We have got at workflow status "A" which have two valid paths: Status "B" and "C".
Status "B" has a condition defined:
"Hide transition from the user (the transition can be triggered only programmatically or from a workflow function). "

Status "C" has no conditions defined.

Moving an issue from status "A" to "B" using the REST interface is invalid and we get the error:

"It seems that you have tried to perform a workflow operation A that is not valid for the current state of this issue <issueid>. The likely cause is that somebody has changed the issue recently, please look at the issue history for details."

The REST url used is:

https://oursite.jira.com/rest/api/latest/issue/<issueid>/transitions

When displaying the valid transitions for the issue (via the REST interface) only status "C" is show as valid.

So! who to move an issue to a status with a condition defined?

The REST service is authenticated with a admin account

 

2 answers

0 vote

You need to remove the "hide transition from user" condition.  

The thing here is that (the transition can be triggered only programmatically or from a workflow function) really does mean you have to be running the transition inside JIRA.   REST is an external interface.  REST is treated exactly as a user is - think of it as an alternative to the web UI.  You've told JIRA to hide the transition from the user, so it can't be seen by REST users.

Well, it was possible via the SOAP interface which also is an external interface?? I don't see the difference. If I remove the conditions the states  will be visible in the UI which I don't want. Is there a way to hide them in the UI without applying a condition.

It's a known bug in the SOAP interface, not supporting the workflow addons correctly. There is no way to hide them in the UI without using Conditions really. You could try it with javascript, but to say that it would be ugly to build and maintain and a doddle to bypass would be a bit of an understatement (oh, and if you've got Agile, forget it, you can't stop them moving between columns without Conditions) But, the best solution for this case is probably quite simple - put in the Condition "Must be user X" if you're doing this with a dedicated account.

That's a fair workaround. Thanks!

you could add a special project role (or group) as condition and set in only your REST user. this will act like transition is not visible to "normal users".

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

523 views 1 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you