• Community
  • Products
  • Jira
  • Questions
  • When a user clicks "Approve" I want to transition to Status A if Field X has value of "A" and Status B if Field X has value of "B". What's the best way to accomplish this?

When a user clicks "Approve" I want to transition to Status A if Field X has value of "A" and Status B if Field X has value of "B". What's the best way to accomplish this?

I'm trying to send an issue to one of two statuses based off of a value that the person sets on transition. Basically, the scenario is I am building an approval workflow where a request goes through 3 different approver steps. In this one step, 2 different people have to approve (and not in any particular order). So, if User A approves and sets that value to A, I want to transition the issue to a status that is "waiting for user B"..and vice versa. Any help would be appreciated. 

1 answer

0 vote

Create two transitions, one with end point A, and a condition saying "field x is A", and a similar transition for the Bs

Hey, thanks so much for the quick response. I should have provided a little more info though. This isn't for a project team, but is something we're delivering to business customers. So, we were hoping to avoid having to tell them to "Click Edit ->Go To the Review Tab -> Set the Field Value -> Click Update" series of events. So, we'd tried the method you recommend, but decided that wasn't the user experience we wanted. What we want is for the user to go to the issue, click approve, we pop up the intermediary screen, they say "User A Approves" or "User B Approves" and then Submit. This keeps them from having to go into the edit issue mode and find the fields they need to update and things. 

We are actually open to using your ScriptRunner product if that would allow an easier way to do this. What we were thinking is that we would set a post-condition that would check the field (to see if it had value A or value B) and then route to status A or status B accordingly (when the user clicked to Submit their approval). Make sense? We just don't have the experience scripting for things like this. Thanks!!

No.  Well, not directly.  A transition only has one end-point.  If you use transition A, it's always going to land in status A.  With Script Runner, what you can do is detect the condition, let it transition to A and then immediately transition to B

However, I'd do it completely differently. 

  • Add an "approved by" multi-user picker field which is not on the edit screens
  • Have a transition back to the current unapproved state
    • Use SR to create a condition of "current user not in 'approved by' field"
    • Use SR to create a post-function that adds "current user" into the "approved by" field
  • Have a second transition that goes to the approved status
    • It needs the two conditions the other transition does, plus
    • Use SR to have a condition on it that says "number of approvers = (required - 1)"

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 Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

677 views 3 11
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