Automation Send Email When Task is Near Due

Cyril James April 21, 2023

Hello Team, I am using the canned automation to send emails with stories are near 3 days from the due date.  Works.

 

I want to modify this to only send emails for stories that are Priority = High or Highest.

 

Do I modify this and if so how, what variables.  Thank you.  You are awesome.

duedate <= endOfDay({{numberOfDaysBeforeDueInclusion}}) AND statusCategory != done AND assignee = {{distinctAssignee}}

2 answers

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2023

Hello @Cyril James 

Whenever asking for help with an Automation Rule, please show us the rule that you have. Often the advice we give depends on the construction of the rule since there are many different ways to accomplish tasks with automation.

If this relates to your other post...

https://community.atlassian.com/t5/Jira-Software-questions/Automation-When-a-task-is-near-due-send-email-reminder/qaq-p/2338384

...and you are using the rule template mentioned by Stephen Wrathall, then you will have to change the JQL in the Lookup Issues actions.

Screen Shot 2023-04-21 at 1.59.08 PM.png

I recommend changing both in the same way.

Add the clause

AND Priority in (High, Highest)

 

You can learn more about constructing JQL queries from the documentation located here.

Cyril James April 24, 2023

Thank you @Trudy Claspill 

 

Does this look correct to only send email notifications for Priority = High or Highest.

 

duedate <= endOfDay({{numberOfDaysBeforeDueInclusion}}) AND statusCategory != done AND assignee = {{distinctAssignee}} AND Priority in (High, Highest)

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2023

Yes, it does look correct.

Cyril James April 24, 2023

ok, I was worried.  There are no {{}} 

 

:-)

Cyril James April 24, 2023

I wish you could test this.  There looks to be an option to test the query but its greyed out for me

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2023

The curly braces {{}} are used in JQL in automation only when you are inserting into the JQL a variable or a specific issue's field value that is known within the Automation. For the criteria and Priority in (High, Highest) there are no variables or references to values in specific issues so there is no need for curly braces.

The option to test the query is greyed out because of the use of variables.

You could test the filter in the Advanced Issue Search screen by substituting actual values where you have variables; i.e.

duedate <= endOfDay(<actual number>) AND statusCategory != done AND assignee = <actual assignee> AND Priority in (High, Highest)

Cyril James April 24, 2023

Thank you Trudy.  You are such a star in the community!

Like Trudy Claspill likes this
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2023

Thank you, Cyril.

If your question has been answered adequately, please consider marking the Answer as Accepted to help other users find posts with validated answers.

Cyril James April 27, 2023

I tried this to add Priority High and Highest and it is not working exactly as planned.  

The automation runs and sends out the emails, yes.  Problem, if there are no High priority issues, the email still gets sent and its blank.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2023

After the Lookup Issues action you can add a Condition / Advanced Compare to check that the number of issues returned is greater than zero. This smart value gives you the number of issues returned by the last Lookup action:

{{lookupIssues.size}}

0 votes
Clark Everson
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2023

Hi Cyril,

when you say automation you mean automation for jira right?

 

if so no need to change your jql just add a condition by field and do priority and choose the ones you want 

best,

clark

Suggest an answer

Log in or Sign up to answer