Workflow status changes -- moving back to previous status only

Debbie Buswell October 29, 2018

Hello,

We have a worklfow that allows transitions from 1 status (Blocked) back to 4 other status (QE, Ready for QE, Development, UAT).  The workflow need to check that when the status is changed from Blocked to one of the 4 statuses it goes back to the original status only. (Example: Development --->  Blocked ---> Development)

What is the best way to do this?  

So far, using boolean as a condition has not worked. Getting syntax errors and not able to debug.

Thank you for your help.

Debbie 

3 answers

1 accepted

0 votes
Answer accepted
Debbie Buswell May 13, 2020

Hello,

An update.  

We were successful in using JMWE to write a validator to check the current, last status from and last status to in order to check if the user was returning to the correct status. The groovy script is in every status that can use the Block status in the workflow.

Eric Sebian August 11, 2021

can you provide the groovy script?

2 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 29, 2018

Hello Debbie,

You can use the Previous Status Condition to each transition in your workflow, so it will ensure that the last status that your issue was transitioned from is the same that it's being moved to.

To do this, you must perform the steps below:

- Navigate to your project > Project settings > Workflows

- Click to edit your workflow

- Click on the transition that comes from the status Blocked to Development > Click on Conditions > Add the Previous Status Condition

- Ensure that the previous status of the issue was Development to allow this transition

- Repeat the same steps for:

 Blocked to QE

 Blocked to Ready for QE

 Blocked to UAT

- Publish your Workflow

P.S: When configuring the Condition, don't forget to flag the option to apply the condition only for the previous status of the issue.

Debbie Buswell October 29, 2018

Petterson,

Thank you for the reply.

I am on JIRA 7.84 and have JSU. I  do not see Previous Status Condition in the condition list page. Is this a plug-in or a built-in feature of JIRA?

Below is a list conditions available.

Thank you for your help.

Debbie 

Conditions:

A field is/isn't initialized

Boolean condition with math, date-time or text-string terms

Cascading select comparer

Check project property

Code Committed Condition

 Compare two parsed texts

Complete session condition

 Condition based on JQL query

Condition based on regular expression

Condition on a list of issue keys

Condition on linked issues

Condition on subtasks

Except assignee

Except reporter

Except users in a field

Hide transition from user

 No Open Reviews Condition

 Only Assignee Condition

 Only Reporter Condition

 Only users in a field

Permission Condition

 Sub-Task Blocking Condition

 Transition is triggered by Bulk Operation

Transition is triggered by Jira Workflow Toolbox post-function

Unreviewed Code Condition

User Is In Any Groups (JSU)

 User Is In Any Roles (JSU)

 User Is In Custom Field (JSU)

 User Is In Group

 User Is In Group Custom Field

 User Is In Project Role

 User is not in project role

Users in a field are/aren't in a project role

Value Field (JSU)

Payne
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.
October 29, 2018

Ah, you have the JSU add-on, so try "Value Field (JSU)" and configure like this:

image.png

https://confluence-apps.beecom.ch/display/JSU/Value+Field+Condition

Debbie Buswell October 29, 2018

Payne,

Thank you for the reply. 

Is Prior Status a custom field in your JIRA?

This is not a valid field for "my" JIRA.

Debbie 

Payne
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.
October 29, 2018

Ah, yes it is. We set it via a post function when we go from a previous status (the 4 you listed, in your case); we are using a different add-on (JMWE) to accomplish that, but it looks like JSU offers that functionality as well: Copy Value From Other Field (JSU)

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 29, 2018

Hello @Debbie Buswell,

Thank you for clarifying that you are using JIRA Server.

The condition I mentioned is only available for JIRA Cloud, however, it can be achieved on JIRA Server by installing the add-on Jira Misc Workflow Extensions.

Debbie Buswell October 29, 2018

Payne,

Thank for the JSU suggestion. This is what I have so far:

I set up a custom field called "Prior Status-Blocked".

In the transition from To-Do to Development I used the post condition of "Copy Value from Other Field" with no precondition, copying Status to Prior Status-Blocked. 

In the transition from Blocked to Development, I set up a condition for Prior Status-Blocked = Development.   When I test, the other 3 statuses show up but not Development.

Other versions are not working either.  I am not able to obtain other plug-ins.  I am also not able to upload screen shots.

Any suggestions are appreciated.

Debbie

Payne
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.
October 30, 2018

Sounds like you're on the right track. Depending upon where your post function is in the order of things, you may be copying "To-Do" rather than "Development" into "Prior Status-Blocked". You'll want to place your post function after the step of "Update change history for an issue and store the issue in the database."

Alternatively, put the post function on the transitions leading to blocked (which is what we do), and put your post function first in the list, while the value of "status" still contains the old value, before it gets set to "blocked".

Hope this helps.

Debbie Buswell November 9, 2018

Hello,

 I continue to work on setting up the logic on the workflow. I did not have any success using JSU, so I downloaded JMWE. The previous condition works for the validation of the flow back from blocked to development, ready for QE, QE, etc, but it prevents the forward flow.

The forward flow is Development, Code Review, Ready for QE, QE, etc. 

Each of the forward flow statuses can also go back to the previous status too.

Now looking at how to combine Previous Condition logic with Current Status logic.

Any insight is appreciated.  

Thank you so much.

Debbie 

0 votes
Jositz, Michael (Allianz SE) November 27, 2020

I guess you can use JSU with "JQL Condition (JSU)" like this:

issuekey = {issue.issuekey} and status was "XY"

Plus stating that "Particular number / More / Less" has to equal 1.

Suggest an answer

Log in or Sign up to answer