Jira Automation Email - Loop Through Issues for each Assignee
Asked by ND:

I am building a Jira automation rule to send a scheduled email with the results from a JQL query. I currently have the email body formatted as such:

```
The following issues are due soon: 
{{#issues}}
<li> <a href="{{toUrl}}">{{key}} - {{summary}}</a> is due on: <b>{{duedate.format("MM/dd/yyyy")}}</b></li>
{{/}}
```

which loops through the issues from the JQL query. However, this loops through *ALL* issues in the query results and sends the email to:

1. All assignees as a group email (if option "Process all issues produced by this trigger in bulk" is selected in the "Scheduled" options)

or

2. Each assignee individually, but with each issue in a different email (if option "Process all issues produced by this trigger in bulk" is *not*selected in the "Scheduled" options)

What I would like is for each assignee to get only one email with all issues in a list. The email should only send to each assignee individually, not as one email with multiple recipients.![Screen Shot 2020-10-07 at 10.45.22 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/113299iF1DCC8DC83656E70/image-size/large?v=v2&px=999 "Screen Shot 2020-10-07 at 10.45.22 AM.png")![Screen Shot 2020-10-07 at 10.45.10 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/113300iAAEFB76995D96304/image-size/large?v=v2&px=999 "Screen Shot 2020-10-07 at 10.45.10 AM.png")

Thanks!


Answers:
author: Sedera Randria
body: Hi [@ND](/t5/user/viewprofilepage/user-id/4116828)

Instead of using Automation, can I suggest 3 easier ways to let users know about approaching due dates?

First, create a JQL filter + save your filter. Edit filter details: update permissions to make sure users can use it. Add an explicit filter name and filter description. Then :

1. In Issue/Manage filters: you can subscribe a group of users to this filter and configure the scheduler to send filter results every day at 9 am.
2. you can also ask interested users to subscribe individually to this filter. And let them configure the scheduler with their preferences.
3. Last: in the filter screen, users have access to Export/RSS feature.

![2020-10-07_17-23-52.png](https://community.atlassian.com/t5/image/serverpage/image-id/113339iC3C8754BE749AFEB/image-size/large?v=v2&px=999 "2020-10-07_17-23-52.png")

What do you think about these suggestions?


author: nmenere
body: [@ND](/t5/user/viewprofilepage/user-id/4116828) I think you are best off going with Sedera's approach. In Automation we have no way of grouping by a user or iterating over a list of users (then running a JQL for them).

[@Sedera Randria](/t5/user/viewprofilepage/user-id/1288711) approach is how I do in my team.

Cheers,

Nick \[Atlassian - Automation Group Product Manager\]


author: St?phanie Rabeyrolles
body: Hello, I can't make a loop and I don't get why...

The mail I receive is empty, no datas at all :\\

I do have ONE issue in a active sprint for my test, but can't figure out how to make my code work

> \<ol\>  
> {{#issues}}  
> \<li\> \[{{key}} {{summary}}\]({{toUrl}}) was transitioned to {{status.name}} \</li\>  
> {{/}}  
> \</ol\>

![Capture d?e?cran 2021-11-08 a? 16.47.14.png](https://community.atlassian.com/t5/image/serverpage/image-id/168368i970E655A7047948A/image-size/large?v=v2&px=999 "Capture d?e?cran 2021-11-08 a? 16.47.14.png")![Capture d?e?cran 2021-11-08 a? 16.45.30.png](https://community.atlassian.com/t5/image/serverpage/image-id/168369iD5984D82A22E245F/image-size/large?v=v2&px=999 "Capture d?e?cran 2021-11-08 a? 16.45.30.png")


Tags: email

loop

notification

smart-value