Create Automation to send one email for a list of closed tickets

Hoa Walsh
Contributor
September 5, 2024

Hi Jira Community!

 

I am trying to use automation to send one email with a list of closed tickets with some details like the key, summary, assignee, and last comment, for each closed ticket.

I found article "Run a rule against issues in bulk" (URL: https://confluence.atlassian.com/automation/run-a-rule-against-issues-in-bulk-993924653.html ) but I think it might be dated because when I ran the automation, it generated an email for each ticket instead of one email with a list of tickets.  Below are my setup and log.

The JQL:

(project = FS AND assignee IN (712020:f033c51b-9d71-4374-88f0-d41003981be4, 712020:e19a5a7e-cdc8-4104-b87c-9dd3953df1f9) AND status IN (Cancel, Canceled, Closed, Completed, Declined, Done, "Done -", Failed, Resolved) AND resolved >= -1d)

 

2024-09-05 22_30_18-Audit log - Automation - Financial Systems - Jira — Mozilla Firefox.png2024-09-05 22_30_25-Audit log - Automation - Financial Systems - Jira — Mozilla Firefox.png2024-09-05 22_29_55-Audit log - Automation - Financial Systems - Jira — Mozilla Firefox.png

Please let me know what I am missing. 

Thank you!  Hoa W

1 answer

1 accepted

1 vote
Answer accepted
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 5, 2024

Hello @Hoa Walsh 

When you put the JQL in the Scheduled trigger then the actions in the rule will be executed for each issue.

Instead put the JQL in a Lookup Issues action. You can then add the entire result set into one email using syntax like this

{{#lookupIssues}}
names of fields in the issue
{{/}}
Hoa Walsh
Contributor
September 6, 2024

Hi @Trudy Claspill !

You've been very patient and helpful in helping me with my ask and I truly appreciate it!  I am a beginner to jira automation, and your assistance has been instrumental in my team's success. So again thank you so much!! <3

With that said, I did move the JQL to the lookup issue action and added the lookup fields and I notice the log shows the information but when the email was sent, it doesn't seem to pull the same information.

2024-09-06 09_36_58-Audit log - Automation - Financial Systems - Jira — Mozilla Firefox.png2024-09-06 09_33_39-Audit log - Automation - Financial Systems - Jira — Mozilla Firefox.png

Hoa

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 6, 2024

Hello @Hoa Walsh 

Your syntax is incorrect here:

Screenshot 2024-09-06 at 8.53.13 AM.png

If you want the header text to appear only once, put it before the {{#lookupIssues}} tag.

Between the {{#lookupIssues}} and {{/}} tags list just the field names and don't use curly braces.

 

Ticket,Created,Assignee,Requestor,Summary,Last Comment.Resolved
{{#lookupIssues}}
key,created,assignee.displayName,summary,last.comment,resolved
{{/}}

 

Hoa Walsh
Contributor
September 6, 2024

Hi @Trudy Claspill ,

I copied your syntax and tried again but the email shows the value as text.

2024-09-06 11_18_11-Rule builder - Automation - Financial Systems - Jira — Mozilla Firefox.png

But the log still show the ticket details correctly.

2024-09-06 11_19_21-issue resolve this week - Message (HTML).png

So when using the lookup smart values (ie {{lookupIssues.key}}), this doesn't show values in the email but it does in the log. 

When I use your syntax in the log, it doesn't pull back the values in the log either.  So I have a feeling the {{lookupIssues.key}} smartvalues is the way to go, at least in the log. 

 

Just for "kicks and giggles", I use the syntax that I had tested out a couple nights ago (I can't find the source to reference here, I will update if I do) and it worked!  I'll have to play around with the fields I need but this is getting me to the right track!

2024-09-06 11_28_38-issue resolve this week - Message (HTML).png

Thank you!

Hoa

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 6, 2024

My apologies! I made a mistake.

Within the email content you do need the curly braces around the field names:

{{key}},{{created}}, etc.

https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues

 

Like Hoa Walsh likes this
Hoa Walsh
Contributor
September 6, 2024

Aaahhhh!  Thank you!  Two steps closer to what I"m trying to achieve.

Now to figure out why the comment only display for the last ticket and not each of the ticket, before that.

2024-09-06 12_55_21-issue resolve this week - Message (HTML).png

Like Trudy Claspill likes this
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 6, 2024
Like Hoa Walsh likes this
Hoa Walsh
Contributor
September 6, 2024

That did the job!  I don't know what to say anymore. LOL

You're the best!! Have a great weekend!

Hoa

Like Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events