Forums

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

How to introduce a delay of 24 hours between two actions in a an automation rule?

Hiya Garg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 12, 2024

I am making a Jira automation rule in which if all the sub-tasks are done, then an email is sent to the reporter of the parent of those issues notifying them that the parent needs to be moved to Done. Then it should wait 24 hours, and if no action is taken, the rule should automatically move the parent to done.

I am not sure how to do that step of waiting 24 hours? 

1 answer

1 vote
John Funk
Community Champion
July 12, 2024

Hi Hiya - Welcome to the Atlassian Community!

You should create another rule based on a Scheduled trigger that will check that each day. 

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.
July 12, 2024

Hi @Hiya Garg -- Welcome to the Atlassian Community!

Adding to John's suggestions...

It is likely when your rule runs and sends the email, that needs to be recorded somewhere in the issue.  For example, using a custom field, comment, label, etc.  Then a second rule could run daily to check if there has been no activity based on the date / time information stored.

You describe wanting to move the parent issue to done in that case.  Please also consider how to properly detect that action was taken instead, and what to do next.

Kind regards,
Bill

Like John Funk likes this
Hiya Garg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 15, 2024

Hey Bill, thanks for your reply.

So first I made a rule that checks that if all child tasks are done, then it sends the email as mentioned, and then it sets the due date of the parent to 24 hours from the current time using {{now.plusDays(1)}}

Then I made another rule as below

Screenshot 2024-07-15 154632.png

The JQL search retrieves all those issues whose due date is surpassed and their status is not done (so it should retrieve all those parent issues whose due date is surpassed, but they haven't been moved to done). Is this similar to what you were suggesting, and is the JOL query correct (both in logic and in syntax)?.. I tried testing the whole rule, it successfully sets the due to 24 hours ahead, but the issue is not moved to done when the second scheduled trigger runs

Like John Funk likes this
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.
July 15, 2024

Yes, that is aligned to what I was suggesting.

Although the JQL is incorrect: when referencing issue fields just use the name without the "issue." prefix.

project = yourProjectName AND duedate < now() AND status != Done

I recommend testing by running your first rule with some examples to set the due date and then running the JQL manually with View All Issues to confirm it works as you expect before enabling the second rule.

 

And I wonder...is the due date used for any other purpose in your project?  If so, this approach may not work as expected.

 

 

Like John Funk likes this

Suggest an answer

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

Atlassian Community Events