Unable to perform workflow transition using REST API

Thomas Fabricius Jørgensen July 20, 2015

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 votes
Taryck BENSIALI June 14, 2016

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".

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 20, 2015

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.

Thomas Fabricius Jørgensen July 21, 2015

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.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 21, 2015

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.

Thomas Fabricius Jørgensen July 21, 2015

That's a fair workaround. Thanks!

Suggest an answer

Log in or Sign up to answer