Forums

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

JQL condition for scheduled Automation rules

Dilyan Yanev March 22, 2023

Hello,

I need help for scheduled Automation rules that I'm trying to run to check for issues in a specific status and how long the issue is in this status from the last time the transition occured. They will run once per day.

In fact, the idea is to be 3 separate automations writing comments in the issue notifying the client that the issue will be closed soon due to inactivity. The last rule will close the issue. Custom field checkboxes are marked to asure that one rule will not be run on the same issue again the next day. Another automation watches for customer comments to unmark checkboxes. This part works fine.

The problem is with the JQL conditions for the rules. They don't check the last time this transition was made but all of the transitions to the status specified in the issue history:

Condition for Rule 1 (transitions in 10 to 19 days ago) 

status changed to "STATUS" BEFORE startOfDay(-10d) AND status changed to "STATUS" AFTER startOfDay(-19d)

Condition for Rule 2 (transitions in 20 to 29 days ago)

status changed to "STATUS" BEFORE startOfDay(-20d) AND status changed to "STATUS" AFTER startOfDay(-29d)

Condition for Rule 3 (transitions in 30+ days)

status changed to "STATUS" BEFORE startOfDay(-30d)

For example, with the first condition I get issues that were transitioned yesterday and in issue history I see they were transitioned in the past to "STATUS", so the rule will run on them. Which will be wrong.

 

Is there a way to add something to the JQL that shows only the last time issues were transitioned to "STATUS"?

Hope I described the task clearly.

Thanks in advance!

3 answers

1 accepted

2 votes
Answer accepted
Fazila Ashraf
Community Champion
March 22, 2023

Hi @Dilyan Yanev 

Welcome to community!

Could you try adding an additional clause that "not Status changed" with the day criteria of -10d in the first rule?

The idea is to ensure that the STATUS stayed the same.. Hope this helps

Dilyan Yanev March 22, 2023

Hello @Fazila Ashraf

status changed to "Waiting for Confirmation" BEFORE startOfDay(-10d) AND status changed to "Waiting for Confirmation" AFTER startOfDay(-19d) AND not status changed to "Waiting for Confirmation" AFTER startOfDay(-10d)

"Waiting for Confirmation" is the desired status.

Is this what you meant? Maybe I typed it wrong. I got an error:

Error in the JQL Query: Expecting either 'OR' or 'AND' but got 'Waiting for Confirmation'. (line 1, character 168)

Fazila Ashraf
Community Champion
March 22, 2023

@Dilyan Yanev  , i meant like adding "AND not status changed AFTER startOfDay(-10d)" to ensure the status didnt go to any other status after the between dates of previous clause

0 votes
Dilyan Yanev March 23, 2023

Just to confirm. It works as expected! :)

0 votes
Dilyan Yanev March 22, 2023

Thank you very much @Fazila Ashraf !

It seems to work now. I'll give additional feedback in the following days :)

Dilyan Yanev April 25, 2023

Still works fine everyday! Thanks again!

Like • Fazila Ashraf likes this

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