Forums

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

jira automation - email sending for ticket with nearing due date

Jihoon Kim _김지훈_
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!
June 15, 2023

Hi, I am trying to use jira automation to send email to the team members who have tickets nearing the duedate and separate email for the overdue tickets.

 

To do so, I made two automation

1. email sent for tickets that has due date of less than 2 days

2. email sent for tickets that has due date passed.

 

The second one works without a problem, but I have a problem with the first one.

 

 

Scheduled

cron : 0 0 8 ? * 2-6 *

JQL : status!="done" AND assignee!="empty"

 

IF : Advanced compare condition

{{issue.duedate.jiraDate}}

less than

{{now.plusDays(3).jiraDate}}

 

------------------------------------------up to this part works well

But the problem was that this function also sends emails to the overdue ticket, so team members were getting 2 emails for the same ticket.

So I added the second condition------------------------------------------------------

 

AND : Advanced compare condition

{{issue.duedate.jiraDate}}

greater than

{{now.jiraDate}}

 

 

Then: Send email

 

 

After I added the AND : Advanced compare condition, it no longer sends emails to anybody.

I double-checked that there are tickets that meet the criteria by using the following JQL on my board.

status!="done" AND assignee!="empty" AND duedate<= 2d AND duedate >= now() 

there are at least 30 tickets 

 

I appreciate any input.

Thank you.

 

 

 

4 answers

1 accepted

1 vote
Answer accepted
Alisa Zamaraeva
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.
June 16, 2023

Hi @Jihoon Kim _김지훈_ 

As I understand you get the right set of issues when filtering with this JQL:

status!="done" AND assignee!="empty" AND duedate<= 2d AND duedate >= now()

So you can try using the same JQL inside the CRON trigger instead of using status!="done" AND assignee!="empty" .

If you want to filter issues with separate action, you can run the same query inside If condition within the rule.

Hope this helps.

0 votes
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.
June 16, 2023

Hello @Jihoon Kim _김지훈_ 

Welcome to the Atlassian community.

Can you share with us the details of the Audit Log for an execution of the rule where there were issues that met the conditions but no email was sent?

0 votes
Deepak Jain
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 15, 2023

You can also accomplish that by using Jira automation also:

  • Go to project settings > Automation
  • Create new rules
  • Trigger: Schedule
  • Choose e.g. to send it one time a working day, at a specific time
  • Click "Run a JQL search and execute actions for each issue in the query."
    • Write your JQL "duedate = startOfDay("+2d")"
    • Validate your query to see that it provides results
  • Add new action "Send email"
    • Compose your email and use smart value to enhance it
    • Choose the recipients (assignee/reporter etc)

Test it before of sending actual emails to people. Hope that helps you.

Jihoon Kim _김지훈_
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!
June 15, 2023

Please read the post thank you.


I am not just trying to send an email. (I can do that already)

what I am trying to do is to figure out why 

 

IF : Advanced compare condition

{{issue.duedate.jiraDate}}

less than

{{now.plusDays(3).jiraDate}}

  

AND : Advanced compare condition

{{issue.duedate.jiraDate}}

greater than

{{now.jiraDate}}

 

 

These two condition does not work

my intention is to send an email for the ticket that has duedate between today ~ the day after tomorrow.

but not for the one with over the duedate. 

0 votes
Deepak Jain
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 15, 2023

Hi @Jihoon Kim _김지훈_  -- Welcome to the Atlassian Community!

You could do this with a saved filter and subscription (Without automation):

project = myProject AND duedate = startOfDay("+10d")

To learn more about filter subscriptions and advanced JQL, please look here:

Cheers !!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events