The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

JQL to return a count of issues due on a specific due date

Jaina Mistry
March 5, 2024

I'm trying to help my team with their workload balance, so would like to create an automation that sends an email when there are over 5 issues due on a specific due date. 

But, I'm having trouble with the JQL I need to populate a variable with the total number of issues due on the Trigger Issue's due date. 

Here's what I have:

{{#=}}{{due = triggerIssue.dueDate}}{{/}}

Where am I going wrong?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Mikael Sandberg
Community Champion
March 5, 2024

Hi @Jaina Mistry,

Welcome to Atlassian Community!

What you have above is an incomplete math calculation, they usually look something like this:

{{#=}}{{issue.Invoice Amount}} * 1.2{{/}}

But instead of using calculation on the due date you could use lookup issues and then use the JQL due = -5d and then check the size on {{lookupIssues}} and then the automation would look something like this:

Screenshot 2024-03-05 at 7.14.50 AM.png 

Jaina Mistry
March 5, 2024

Thank you, @Mikael Sandberg, this is really helpful! 

I'm trying to trigger the automation when an issue is assigned to a user. So I tried using 

due = {{triggerIssue.dueDate}}

in lookupIssues.

But when I test the automation, there are no errors. The audit log it shows that the issues did not match the condition. 

This leads me to think it's not possible to trigger this on issue creation. 

Mikael Sandberg
Community Champion
March 5, 2024

Do you know the size of lookupIssues? I would add a log action to see what {{lookupIssues.size}} returns. 

Jaina Mistry
March 5, 2024

That log action was key @Mikael Sandberg ! I didn't know I could do that. 

The variable wasn't getting populated with a value because I did not use the write letter-casing for {{lookupIssues.size}}

Here's what the final automation looks like: 

Audit log - Automation - Marketing Team - Jira 2024-03-05 at 14.59.21.jpg

Thanks again for your help, Mikael! 

Like Mikael Sandberg likes this