Forums

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

JQL - Get issues that was moved to a status in the last day then add another condition

Paul McGrellis November 2, 2022

Hi,

I have a query configured that finds issues that has changed status to 'Acceptance Test' in the last 24 hours but unsure of how to add another condition.

My scenario is as follows:

I basically want to only find issues for the status changed and it's still in that status 24 hours later. This will then send an email out at 9am if the condition is met.

Here is my query: (I originally had the query as AFTER -1d but for some reason it isn't working like that anymore)

project = 'WEB' AND sprint in openSprints() AND status changed TO 'Acceptance Test' AFTER startOfDay(-24) AND resolution = NULL

I have returned 7 issue with the above query. My question is that, if i move an issue to 'Acceptance Test' at 8am, will the rule pick it up and send the email out at 9am? Or will it only find issues when the 24 hours has elapsed?

EDIT - Can someone tell me if this query would do what I need? 

project = 'WEB' AND sprint in openSprints() AND status = "Acceptance Test" AND status changed TO "Acceptance Test" BEFORE -1d AND resolution = NULL

 

Cleaner Query:

project = 'WEB' AND sprint in openSprints() AND NOT status changed AFTER -1d AND status = "Acceptance Test" AND resolution = NULL

1 answer

1 vote
Walter Buggenhout
Community Champion
November 2, 2022

Hi @Paul McGrellis,

The following JQL should come close:

Project = WEB AND sprint in openSprints() AND status changed to "Acceptance Test"
AFTER -1d AND status = "Acceptance Test"

Assuming that you don't set a value for the resolution field when you move your issues into the Acceptance Test status, the resolution part of your JQL does not add any additional value.

Hope this helps!

Paul McGrellis November 2, 2022

Thanks @Walter Buggenhout 

The JQL doesn't return any issue's unfortunately.

I'm getting the correct issue back with this query so hopefully it will hold up.

project = 'WEB' AND sprint in openSprints() AND status = "Acceptance Test" AND NOT status changed AFTER -1d
Walter Buggenhout
Community Champion
November 2, 2022

Ah, ok. That means you want to find issues that have changed status more than 24 hours ago and are still in the same status. Your query would indeed work for that use case, but if you want to search positively, you could also use:

project = 'WEB' AND sprint in openSprints() AND status = "Acceptance Test"
AND status changed to "Acceptance Test" BEFORE -1d
Paul McGrellis November 9, 2022

@Walter Buggenhout Thanks for that.

It is retrieving the correct issue's but for some reason it is not sending out the added condition email.

I have the above query setup as a WHEN component with the Send email trigger as a THEN component afterwards. 

Any ideas how I would so this? Do i need to call the Send Email action within the query somehow? I have to manually click on the Run Rule option to send the email.

Automation Rule.png

Paul McGrellis November 9, 2022

@Walter Buggenhout Think I was doing it wrong.

Does this look any better? 

Automation Rule.png

Suggest an answer

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

Atlassian Community Events