Can Jira Automation be used to send users a list of issues that are due in the next N days?
Asked by Elvar B??varsson:

I'm using an automation job to search for issues that are overdue and send reminder emails to the assignee.

What I want to do now is send a similar email on Mondays with a list of issues that are due that week.

Can Jira Automation be used for this or is the only solution to create an issue filter and tell people to subscribe to it?


Answers:
author: Tom Williams
body: Yes this can be done using Jira Automation.

Set the automation on a schedule using a Cron Expression, then use the action "Lookup Issues" provide the JQL to return the issues due that week.

Then add the "send email" action and include the following in the email body to print out a list of the issues;

    {{#lookupIssues}}* {{key}} | {{summary}} [.....etc]{{/}}

Where key, summary can be replaced or added to with these smart values, (custom fields in the future hopefully)

* {{key}} - Returns the issue key

* {{url}} - Returns the issue url

* {{summary}} - Returns the issue summary

* {{assignee.displayName}} - Returns the assignee

* {{reporter.displayName}} - Returns the reporter

* {{status}} - Returns the status

* {{issueType}} - Returns the issue type

* {{resolution}} - Returns the resolution status

* {{fixVersion}} - Returns the fix version

* {{created}} - Returns the date the issue was created

* {{updated}} - Returns the date the issue was updated

* {{Story Points}} - Returns the story points for the issue (classic Jira Software)

* {{Story point estimate}} - Returns the story points for the issue (next-gen Jira Software). Learn more about using smart values with numbers.

Source: [https://support.atlassian.com/jira-core-cloud/docs/automation-actions/](https://support.atlassian.com/jira-core-cloud/docs/automation-actions/??)

comments: author: Elvar B??varsson
body: Can this be used in a way that each assignee only gets sent their issues?


author: Tom Williams
body: If you're just running this for your scrum team or a small group perhaps you could just sort the JQL by the assignee and include {{assignee.displayName}} in the email so each person's tickets are grouped together and visible in the list.

OR// If you have a small number of assignee's that don't change often you could include the assignee in the JQL and create a separate rule for each person.

HOWEVER// If the group of assignees is large and always changing, which would make this a nightmare to maintain I'd suggest going with [@KAGITHALA BABU ANVESH](/t5/user/viewprofilepage/user-id/4194998) 's solution but they'd end up with an email for each.


author: Elvar B??varsson
body: As the people needing the notification are a few I defined the emails specifically in the automation configuration.

I tried to have the assignee as the recipient but that did not work because in the initial trigger there is no JQL query and the assignee value is from that query. Not from the look up issue filter.

Works for now, thanks for the information.


author: Tom Williams
body: Wasn't sure if this would work but it did :) !!!!!

{{lookupIssues.assignee.emailAddress}}

![Screenshot 2021-01-27 120831.png](https://community.atlassian.com/t5/image/serverpage/image-id/127561i7D08B396E23CC284/image-size/large?v=v2&px=999 "Screenshot 2021-01-27 120831.png")


author: Bill Sheboy
body: Thanks, Tom. Please note there is a specific suggestion to make this better by only including the issues in the lookup for each assignee:

<https://codebarrel.atlassian.net/browse/AUT-1975>

__Bill


author: Kim Dinh
body: Is the "Lookup Issues" action only available on Cloud version? I've been poring over all the options and do not see this one.


author: Bill Sheboy
body: Hi [@Kim Dinh](/t5/user/viewprofilepage/user-id/1633360)

Yes, Lookup Issues is in Cloud only. The equivalent in Server version is the smart value {{issues}} Please note the plural as this is a list.

<https://confluence.atlassian.com/automation/smart-values-993924860.html>

Best regards,

Bill


author: Kim Dinh
body: [@Bill](/t5/user/viewprofilepage/user-id/544855)Sorry to bug you but I can't figure out what's wrong. I have this block in my Send Email action. I get the email, but none of the data is displayed, just the \|. I know the query is working, because I can see the list of tickets in Audit Log.

\| \|   
\| \|   
\| \|   
\| \|   
\| \|   
\| \|   
\| \|   
\| \|   
\| \|   
\| \|   
\| \|   
...

{{#issues}}  
{{#issues}}{{key}}{{/}} \| {{#issues}}{{summary}}{{/}} \| {{#issues}}{{status.name}}{{/}}  
{{/}}

Can you help? Is my syntax wrong?

Thanks much in advance!


author: Bill Sheboy
body: Hi [@Kim Dinh](/t5/user/viewprofilepage/user-id/1633360) No worries; glad to try to help.

When you loop over the issues, you only need the iterator stuff one time. Like this to iterate one time over the {{issues}}.

{{#issues}}  
{{key}} \| {{summary}} \| {{status.name}}  
{{/}}

And, I am unclear for the Server version if anything *odd* happens with pipe (\|) processing. If that still doesn't work, try replacing the pipes with another character.

__Bill


author: Kim Dinh
body: That works, thanks [@Bill](/t5/user/viewprofilepage/user-id/544855) !


author: Bill Sheboy
body: Hi [@Elvar B??varsson](/t5/user/viewprofilepage/user-id/697539)

You may also send a single email with the upcoming due items by creating a saved/shared filter and then **subscribing** to it. People who want the email can subscribe (for shared filters.)

Please see here to learn more about this feature:

<https://support.atlassian.com/jira-core-cloud/docs/work-with-search-results/>

Best regards,

Bill

comments: author: Elvar B??varsson
body: I know about this feature and prefer not to use it as it just sends a dull list of issues. Much prefer Automation as with that I can include custom text.

Now if it were possible to combine those two :D have filters which people could subscribe to at will and that the email sent would be customizable by the filter owner


author: Bill Sheboy
body: Here are some suggestions to improve subscription emails, which you may watch or vote for:

[https://jira.atlassian.com/issues/?jql=project%20IN%20(JRACLOUD%2C%20JSWCLOUD)%20AND%20resolution%20%3D%20Unresolved%20AND%20summary%20\~%20subscription%20AND%20summary%20\~%20email%20ORDER%20BY%20Key](https://jira.atlassian.com/issues/?jql=project%20IN%20(JRACLOUD%2C%20JSWCLOUD)%20AND%20resolution%20%3D%20Unresolved%20AND%20summary%20~%20subscription%20AND%20summary%20~%20email%20ORDER%20BY%20Key)


author: KAGITHALA BABU ANVESH
body: Hello,

Please try this once.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/127218i376694A440360260/image-size/large?v=v2&px=999 "image.png")

Every Monday 8.15 AM. assignee will notified with Due Date.

Cron+ JQL

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/127219i6DA4F523DB71C571/image-size/large?v=v2&px=999 "image.png")New Action

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/127220i79CFEAAFDA6CCE36/image-size/large?v=v2&px=999 "image.png")

Hey sorry , I thought it's for a week.

Thanks.

comments: author: Tom Williams
body: This works but sends an individual email for each issue returned in the JQL. My solution below returns a list that could be sent in a single email.


author: KAGITHALA BABU ANVESH
body: Hi Tom,

Thanks for the information.


Tags: jira-cloud