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

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events