Triggering Transitions by using a custom field

I want to create a field called "Risk" field - meaning if fixing this bug or adding this feature is risky or not. (Low, Medium, High)

What I want is that when the risk is "High" I want another transition to be execute into a step called approval - that will give a user with the rule Approver the ability to decline/approve the task.

Only after the task(fixing the bug or adding the feature) is approved the status will continue to next step.

(Please also if you can add an explanation how to allow only someone with the "role" Approver to be able to approve the task)

If the risk is Medium or Low it will continue without transition to the next step.

Thank you in Advance,

Cohen Liron

2 answers

1 accepted

What you have to do is to ban the next transition if your risk is High. You can do it by adding a new Condition on your transition which checks your custom field value.

Let's say your workflow is now like this: "A --> B --> C", but you want this for High risk issues: "A --> B --> Approval --> C"

In this example, you should ban the transition "B --> C" if the issue is in High risk, allowing the transition "B --> Approval" in this case. Both transitions "B --> C" and "B --> Approval" would appear on your workflow design.

Regarding your question about the role "Approver", it is another condition on your transition "Approval --> C". The type of condition is "User is in Project Role".

Have a look to JIRA documentation on configuring workflows.

Cheers

Sergio

Are you reffering to the "Value Field Condition" in "Jira Suit Utilities"?

The basic Jira (5.1) don't have that feature.

The "Jira Suit Utilities" did the trick. I'll post later how I have implemented the solution.

Thank you very much!

Yes, you're right. I installed that plugin so early in my implementation that I consider it as part of JIRA core, although it is not :)

Good luck! You'll get it, it's not a big deal.

Solution was as Sergio suggested.

Using the Field "Risk" and adding a transition to "Need Approval" state.

  • Inside the transition I added condition if "Risk" is "High"

Added another transition to "In Progress"

  • The condition to it was that "Risk" is not "High"

Adding a "Role" called "Approvers" and adding users there.

From state "Need Approval" created 2 transitions - "Deny" and "Approve"

  • Both has a condition that only user from role "Approvers" can initiate it.

Reopen Issue problem:

  • What happend if issue was opened, needed approval, was approved and then (after 0 or more steps) closes.
  • If we wanted to "Reopen" the issue we will need to re-Approve it.

Solution:

  • I've created new field called "Approved" and configured it to "Yes" and "No" (select list) - and made the default as "No"
  • The new field will not be visible in any of the screens.
  • To the "Need Approval" transition I've added: and "Approved" is "No"
  • To the "In Progress" transition I've added: or "Approved" is "Yes"
  • This will make the transition to "In Progress" if the issue was approved before (The field actually save the state of the approval without letting the user change it
  • In order for user to see this field I've created new screen (duplicated the original) and added the field - The screen was assigned only to the "View Issue" - so the user can't edit it yet he can see it.

Sergio thank you very much - You've helped me alot.

You may need a listener, not a condition, to transition it automatically to the Approval state. If not, you can stick to the condition

Check this, even if you're not using our plugins, you can borrow the idea: http://confluence.kepler-rominfo.com/display/TR/Start+progress+on+an+issue+only+after+the+approval+of+project+manager

Thank you Radu on this link - This is a very interesting solution here.

Right now the "Jira Suite Utilities" was already installed before and I was instructed not to add any more addons to the system.

In any case thank you and I will use this information if the future.

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,798 views 11 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