Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to have a condition for exiting a status?

Alex Lock
Contributor
March 10, 2023

We have a workflow at our organisation where everything is transition to all as it's a small team with fluid changes, so don't need a process.

However, we'd like some guard rails to ensure that when leaving a status, they provide some key details before moving to another status. How do I do this? I can see the transition to the status in question, but not possibility to limit it leaving? 

Alternatively, is possible to (painfully) put conditions on all other transitions to validate from a certain status?

2 answers

1 vote
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 10, 2023

Hi @Alex Lock , first you will need to use a Company Managed Project and you will need to move away fro the "All" transition for the status where control is desired. Once this is done you can add validators and a screen to the transition out of the status. One other option, would be to use Automation to move the issue back to the previous status and send an email to the user to provide the necessary details.  This is a bit of a kluge IMO.

Alex Lock
Contributor
March 10, 2023

Yeah, that sounds like a pain. There's no appetite to change the workflow and it's caused me a few headaches. I'll consider the automation though, but agreed, that's a bit of a kluge

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 10, 2023

edited reply as I misplaced my response...



You certainly could use Automation...

trigger - transition (from any to Done)

condition - field condition Root cause is empty

action - email user triggering rule "please enter Root cause"

0 votes
Oliver Siebenmarck _Polymetis Apps_
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.
March 10, 2023

Hi @Alex Lock ,

So, your workflow has these transitions that go into a status from any other status. And you would like to restrict this in some cases, but not all cases. And you do not want to move away from the "All" transitions.

I believe you can do this using validators, although there might some extra work, depending on what exactly is needed. In any case, for the following approach you will need one of the many workflow apps that support Jira Expressions. My recommendation is Cloud Workflows, but I do work for that vendor. As far as I know, the other options work equally well. The important thing is, that Jira Expressions are supported. 

Now, the great thing about Expression-based Validators is that you get to look at the current transition and therefore let the Validator behave differently, depending on the current status and the target status. Let me go on a quick Expressions deep dive to provide an example:

Say you have three status: New, In Progress and Done. You want every status to be able to go into every other status, so Done only has one incoming transition. But if someone goes from New to Done, you want at least one comment on that issue. If the issue has already been in In Progress, you do not care about that.

The way to achieve this would be a Validator on the incoming transition to Done that uses an Expression like this:

transition.from.name != "New" || issue.comments.length < 0

The expression has two parts, the first part (left of ||) tests if we are moving from the New status. If so, the first part becomes false and we have to look at the second part. That counts the number of comments and checks if there is more than 0 comments. 

On the users side, this will look like any normal transition until they try to move from New to Done without a comment being present. In that case, the issue will be put back in its original state and the user sees an error message.

I hope that helps and makes sense for you. Let me know if I was unclear, I'm happy to help. 

Cheers,
 OIiver

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events