Forums

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

Automation for Jira - Emails sending after lookup - sends 25 emails with list of 25 results

Karen Bottai
Contributor
September 19, 2023

Working on Setting a rule for sending out a LIST of issues with a certain due date or past due date.

Schedule - every 1 day at 9am

Then - Lookup issues  -- status ='to do'

AND

Send email to (specific email address) 

Email content - <ul>
{{#lookupIssues}}
<li>{{key}} - {{summary}}</li>
{{/}}
</ul>

 

The lookup returns (in our case) 25 results

The automation works - we run it manually, but it sends 25 emails with the list of 25 results.

How can we get it to send ONE email with the list of 25 results?

1 answer

1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 19, 2023

Hello @Karen Bottai 

Can you show us the details of your rule?

Do you have a JQL specified in the trigger?

When you use a Schedule trigger and specify a JQL in that trigger, the remaining actions in the rule will be executed once for every issue found the the JQL in the trigger.

To prevent that you need to not have a JQL specified in the trigger.

Karen Bottai
Contributor
September 20, 2023

we tried the JQL trigger, which made it not work. 

 

The Details are above  really ---- nothing else to it.


Trigger: Scheduled (no JQL trigger)

Issue Lookup: JQL is status=to do

Send Email: (to specific address) (specific list above for content)


We sliced and diced this many ways but with a JQL trigger or without... it ALWAYS sends multiple emails instead of 1 email with a list of issues. 

 

End goal: Send an email with a list of issues based off of due date +7 days

and then another one based off due date -7 days.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 20, 2023

Hello @Karen Bottai 

Can you please provide a screen image showing your rule and show the details of each component?

Karen Bottai
Contributor
September 21, 2023

Snag_2eacdf2.png Snag_2eb86f1.png

 

Snag_2ef586b.png

As you can see, we have 24 issues. This setting will send 24 emails with a list of 24 issues in each email. 

The other issue we happen to have if we try to test the automation is if it is scheduled to anything other than a few minutes (say 9am on Monday) and we try to click save then "Run Rule" it does not run the rule. It used to run the rule when we did this, but for testing purposes we have it set for every 5 minutes. 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 21, 2023

Your Trigger has a JQL statement. As noted there is the trigger the actions will be executed for each issue retrieved by the JQL. If that JQL retrieves 24 issues, the the Lookup and Send actions will be executed 24 times.

Screenshot 2023-09-21 at 9.14.31 AM.png

Karen Bottai
Contributor
September 22, 2023

How do I get around this to send one ? I just want to see the To do status list in one email.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2023

Remove the JQL from the Scheduled trigger.

Then the Lookup Issues action will run once to retrieve the issues in the "to do" status, and the Send Email action will run once to send the results as an email.

Karen Bottai
Contributor
September 27, 2023

Okay so that worked for the first automation that was simple, now we tried something more complex and the list and it comes out as a blank email.

Snag_3f6128a.png Snag_3f61fc8.png Snag_3f629fa.png Snag_3f638bf.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 27, 2023

When you are trying to display/print entries in a Lookup Issues list using this syntax

{{#lookupIssues}}
print fields from each issue
{{/}}

... the examples all just use the field name

{{#lookupIssues}}
{{url}}
{{/}}

 

In yours you added "issue." as a prefix to the field name. Try removing "issue." 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events