Automation LookUpIssues doesn't send notifications
Asked by Gil:

Hi community,

I have setup a scheduled automation to generate a list of all ON HOLD items and send an email notification with the list of issues.

The only complexity in my case is that I want to count how many days a given issue is stuck in the ON HOLD status.

I created a custom field which time stamps an issue when it transitions to the ON HOLD status.

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

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

The log shows that it finds issues, but I have no idea why it doesn't send the email:

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

any thoughts?


Answers:
author: Bill Sheboy
body: Hi [@Gil](/t5/user/viewprofilepage/user-id/1264836)

Does the scheduled trigger for your rule have JQL? From what you describe, it probably should not when you want to send a single notification: then the notification can come from the Lookup Issues result.

Rather than use a separate condition, have you tried using JQL with your lookup to compare your custom field to now? That would filter the results in a single step before sending the notification.

Kind regards,  
Bill

comments: author: Bill Sheboy
body: Hi [@Gil](/t5/user/viewprofilepage/user-id/1264836)

Just following up to ask if the suggested answers solved your question. If so, please consider marking this one as answered to help others find solutions to similar needs faster. Thanks!

If not, what is not working as expected?

If the email is still not being sent for the rule you showed, some of the possible causes are:

* if you are on the Free Jira license level, your site may have exceeded the maximum emails in a 24 hour period: 100 emails
* the email address may be incorrect in the action
* the emails may be getting blocked on the receiving side, such as marked as spam

Kind regards,  
Bill


author: Santino Lucca Castrataro
body: Hi [@Gil](/t5/user/viewprofilepage/user-id/1264836)! I thinks the problem is that you are not actually saving the issues, you are actually collecting all the issues in "ON HOLD" status and filtreing them.

I see 2 possible solutions (In both of them you have to remove the IF):

1) **Send one email per issue:**Use the JQL Branch and put the JQL to search for issues with the same conditions as you put in the IF. Then, in the email, use smart values using "issue." to search for the information that you need to display on the mail.

2) **Send one email for all issues:** You shall use just the lookupIssues with the JQL that gets all issues that you need, and then send an email like the one is talked about in here: <https://community.atlassian.com/t5/Jira-Software-questions/Sending-an-email-with-a-list-of-issues-using-Automation-for-Jira/qaq-p/1192501>. In that link you will find all the information that?s necessary to send an email that contains the information of various issues.

Let me know if you need more help!

comments: author: Gil
body: Thanks for the reply.

I'm trying to go for option 2. Option 1 works but it spams our inbox.

With option two, how do I save the issues? I thought the using the **Lookup Issues** block is saving them and then in the:

**{{#lookupIssues}}
\* {{key}}
{{/}}**

I'm calling them. However, the email is not generated.


author: Santino Lucca Castrataro
body: I think the smart value you are using is correct. Did you check who are you sending the email?


author: Gil
body: I'm sending to myself


Tags: addon-com.codebarrel.addons.automation

cloud

jira-software

jira-software-cloud