Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,179
Community Members
 
Community Events
184
Community Groups

JQL condition for scheduled Automation rules

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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 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

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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 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

Just to confirm. It works as expected! :)

Thank you very much @Fazila Ashraf !

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

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
Site Admin
TAGS
AUG Leaders

Atlassian Community Events