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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

64 views 0 5
Read article

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