I want to create a conditional transition based on the contents of a simple single yes / no checkbox. I've created the checkbox. I've created the transition between state 1 and 2, and 1 and 3. I can see how to apply a condition to the transition, but it is not clear how I define the check. Am expecting some sort of field check, but its not clear at all.
Does anyone have any ideas.
Actually, you can't do this the way you're thinking.
You've already noted that a condition will prevent/allow a transition to show on the basis of *existing* data - that is, what is on the issue before the user goes into the view screen. That solves your problem for existing data - define two transitions with opposing conditions (one has "allow if checkbox = yes", and the other "allow if checkbox = no"), but it doesn't help you with the case where you put the check box on a transition screen and the user changes it. This is because the condition checks are done before any transition, and the change of data happens during the transition.
The other two options on a transition won't help you either.
Validators accept the input from the users, so they look like a possibility, until you realise that all they can do is return a true or false. True allows Jira to continue the transition, false throws the user back to the screen they were in with an "invalid data" message. So that's no good.
Post functions execute after the transition is completely validated, and can do all sorts of data processing. But ultimately, there's a structural problem - the post-function is running inside the transition, and your code would need to stop that dead and start running the other transition, which is an absolute bloody nightmare to code around. I don't know of anyone who's managed to do this successfully, and the people I know who have tried have said they would need to hack the os_workflow library apart to do it.
There is a reasonably simple work-around though.
Given your states 1, 2 and 3, set up
Far from ideal, but that's the only way I know of doing it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The above was just a snippet of the workflow. The decision on whether to progress to state 2 or 3 is made some states before state 1 (Its actually at creation this field is set). In other words the checkbox is in the correct state on entering state 1. In any event it would be useful to know the syntax used for checking checkboxes...
Your help is much appreciated - from a JIRA newbie.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By "conditional transition" I read a condition for a transition. It sounds like Nic is reading an automatic transition if a condition is true. If that's what you're after, and by your own answer I don't think it is, take a look at auto-transition. Plugin details on parent page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.