Workflow Path based on Select List

Jason J November 12, 2015

Hello,

I am trying to take a different workflow path based on a select list choice from the user.  Meaning if the user selects Yes it would take one workflow path, if the user selects No it would take another.

Any ideas?

Thanks for the help!

 

2 answers

1 accepted

1 vote
Answer accepted
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.
November 12, 2015

You can't really do this in one go. 

If you are ok with a two-step process, then you can simply set mutually opposing conditions on the two paths (on transition 1, "if cf = yes" and on transition 2, "if cf != yes").  The users will only ever be offered one transition, based on the current setting of the field.

What you can't do easily is put the field on the screen and then let it choose the transition that runs when the user commits it.  This is because they've already started the transition when they get to the screen, so they've already chosen.

Two workarounds:

  1. The ugly one: Use something like the script-runner.  If the user chooses "yes", then transition to status X and do nothing else.  If they choose no, then use the auto-transition tricks to push the issue to status Y immediately after X.
  2. The sneaky reverse the question trick: remove the field from the transition screen, give the user both transitions to X and Y, with clear names, and then set the field according to what they choose.

    On the second one, as an example, imagine the flag is something like "is this over £2,000 in value?".  Instead of yes/no on screen, offer them transitions for "Less than £2,000" and "£2,000 or more"
Jason J November 12, 2015

Hello,

Let me give an example.  On issue creation we capture a few different variables through some select lists.  Things like if a PMO resource should be involved or potentially someone from marketing or editorial.  This information is captured by selecting Yes in select list.  Later in the workflow, assuming one of these values were selected, we would work into an alternative workflow (as part of the same workflow of course).  Once we capture the additional information in this step we would then transition back into the main workflow.

Let me know if this makes better sense.

Sten Sundelin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 12, 2015

So in status 'A' or 'B' a user decides that to check a checkbox (or enter 'y' in a field or similar boolean function).

Later, in status 'D', create two transitions, to 'tE' and 'tD1'

Conditions on each:

'tE' - if ((checkbox = unchecked) OR (all conditional values populated)) , allow transition to status 'E'

'tD1' - if ((checkbox = checked) AND NOT (all conditional values populated))  display screen with conditional fields, transition back to status 'D'

 

This should only display the correct button depending on state of affairs.

 

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.
November 12, 2015

Right, so it's the two-step case I mentioned earlier, which is quite easy to implement.

Jason J November 13, 2015

Would this be a validator and not 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.
November 13, 2015

No. A Condition will hide a transition from a user. A validator checks data is ok after the user has tried to commit the transition.

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.
November 13, 2015

What you're describing is a situation where you can check data before offering the user the chance to do something. So it's a Condition. You want two opposing ones.

Jason J November 13, 2015

Which condition should I add. There doesn't seem to be a condition which looks at a custom field.

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.
November 13, 2015

Ah, yes, sorry, completely forgot - you'll need an add-on to provide the conditions. The JIRA Suite Utilities has one for custom fields if memory serves. (It's a well supported and free add-on)

chrissmithhill April 13, 2018

Surprised this is not a built in feature. 

Jonathan Harber February 5, 2020

Where does one add the conditional statements?  In the Issue Creation Screen is a field named Purchase Method with 3 choices. 

  1. None
  2. Cash
  3. Credit

I have 2 transitions out of the of the Issue Creation Screen.  Transition 1: Purchase Method Cash and Transition 2: Purchase Method Credit.  Where does one add the conditional statements?

Thanks

0 votes
Jason J November 16, 2015

Nic's original answer worked perfect.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events