• 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 votes

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,968 views 12 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot