Automation Check for First Time

JD.Lobue March 11, 2024

I'm looking to add an action if and only if it is the first time the status has changed from one status to the next in the workflow and ignore if it is subsequent times. Suggestions?

 

Thanks

5 answers

1 vote
Bhanu KN
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 11, 2024

Hi @JD.Lobue

I am assuming you want to add an action for the transition from Status A -> Status B. Additionally, perform the action only if the issue hasn't been in Status B before. 

You could try using the JQL validator 'status was not in (Status B)'. 

Let me know if that helps :)

Regards,

Bhanu

JD.Lobue March 11, 2024

What would be the syntax be for status was not in before.....??

Kalyan Sattaluri
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 11, 2024

Hello @JD.Lobue 

As @Bhanu KN has mentioned,  JQL syntax will be 

project = XXX and status was not "In Progress" 

(you can ignore the project = XXXX part in your rule)

So if you have a trigger of "status changed", then you first check if issue status = "statusB" and if so, you do another If condition -> JQL -> status was not "statusB"

Then you do your steps.

Please review below link for more details:

https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#WAS-IN:~:text=WAS%20NOT%20IN,Priority%2C%C2%A0%C2%A0Reporter%2C%C2%A0Resolution%2C%20and%C2%A0Status%C2%A0fields%20only.

 

Bill Sheboy
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 11, 2024

Hello @JD.Lobue 

Yes, and...to this suggestion:

If you use, or have ever used in the past, any team-managed projects in your Jira site: the status changed operators for JQL may not work as expected.  Here is the defect for that symptom: https://jira.atlassian.com/browse/JRACLOUD-78387

The work-around is to use the id values of the statuses rather than their names.

Kind regards,
Bill

0 votes
Evaldas August 7, 2024

Maybe not a proper solution in your situation, but in other cases it could be better to change the workflow to allow only one-way transition from status X to status Y so that Automation will be triggered only when Issue transitioned from X to Y, for ex.:

image.png

0 votes
Ricardo Martinez May 8, 2024

If you want to check for the first time, "was not in (X)" does not help you since:

 

The "WAS" operator is used to find issues that currently have, or previously had, the specified value for the specified field. (Note: This operator can be used with the Assignee, Fix Version, Priority, Reporter, Resolution and Status fields only.)

 

So if you put a jql with "was not in (X)", since the status IS X, it wont work as it is.

 

I managed this with this jql "status was not in (X) BEFORE -1m" checking if it was not in that status before 1 minute, and since you have this in the transition itself, you should be able to make it work.

 

See image for my example with "In Progress"Captura de pantalla 2024-05-08 a las 13.55.47.png

Bill Sheboy
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.
May 8, 2024

Hi @Ricardo Martinez 

Please review the other posts in this thread, particularly if you have ever (or currently do) have any team-managed projects in your site.  The WAS operator does not work consistently if there are / were team-managed projects, even when the workaround of using the status id values in the JQL is used.  The defects for this symptom in the public Jira backlog are marked as either timed-out or "won't fix".

Kind regards,
Bill

0 votes
John Funk
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 11, 2024

Hi JD,

You might try creating a custom field - just a radio button with a Yes/No or a Checklist with just Yes. Then when the issue moves to that status for the first time, set the value to use. You should be able to hide the custom field from the screen. 

Then you can check with your automation as to whether that field has a value of Yes or not. 

0 votes
Kalyan Sattaluri
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 11, 2024

Hello @JD.Lobue 

Another solution is, you will have to store an "indicator" in a custom field or entity property, whenever an issue has transitioned from a particular status or whatever your criteria is.

And your rule will check for this value/indicator (can be anything) and if it exists, it does nothing, if it does not, your rule continues with your action steps and finally you update this field for future.

And because this approach is go forward, whatever method (custom field or entity property) you choose, you have to bulk update that for all historical issues so they dont get triggered unnecessarily.

JD.Lobue March 11, 2024

yeah...that is not going to work.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events