Jira Cloud Lookup Automation sending multiple emails. Need one email with all issues from Lookup.

sarai.makni June 29, 2021

Hello,

I have an automation triggered by a new comment. After the trigger occurs, I use custom JQL to gather a list of issues and send an email using the lookup smart values. The JQL returns 3 issues but instead of getting one email with all 3 issues, I get 3 duplicate emails with all 3 issues in the body.

What is working: The JQL returns the issues I need and the email is populated with the list of issues

What is not working: I receive 3 emails instead of 1


Is there something missing in my automation? Do I need to place the lookup/email actions in a Branch?

Thank you!

 

1 answer

1 accepted

2 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2021

Hi @sarai.makni 

For Jira Cloud automation, Lookup Issues is one way to send the batch in one email, versus branch/scheduled rule to send multiple emails. Perhaps like this:

  • trigger: issue commented
  • action: lookup issues: with your JQL
  • action: send email, with the lookup issues contents, such as 
{{#lookupIssues}}
* {{key}}
{{/}}

Please post an image of your rule and the community will have better context to help you.

Best regards,
Bill

sarai.makni June 29, 2021

Hello! The steps you described are my current steps but I am still receiving multiple emails....

Capture.PNG

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2021

Thanks for that information.  Perhaps you could explain your use case further...

When an issue is commented, the rule is triggered, and you send an email for a list of issues found by JQL.

  • This will send an email whenever any issue in the project is commented upon.  Is that what you wanted, or did you want to email when a specific comment is made?  If so, add a condition after the trigger to check the contents of the {{issue.comment.body}}
  • Or, is this the incorrect trigger for your use case, and some other event should be trigging it?

Thanks any clarity you can add!

sarai.makni June 29, 2021

Hi Bill!

Here are the start to finish steps:

Automation 1:

  • Trigger: Version is released
  • Action: A comment is created with the name of the fixVersion.

Automation 2 (screenshot above) triggered by Automation 1:

  • Trigger: A new comment is created
  • I use the Lookup to narrow the Issues down to those containing the specific team's version name in the comments.
  • Of those results, I email the list of issues identified in the lookup

Reason for running 2 automations instead of just using one "Version Released" trigger. Our teams format their versions as "TeamName - Date of Release".  Jira Cloud does not allow "~" on the fixVersion field so I could not write custom JQL to say "When the fixVersion ~ "TeamName" then Lookup issues and email list." The way I found around it, is to put the fixVersion name in a field where I can use the "~". Then, since I cannot have multiple triggers in a single automation, I created the second automation and checked the box for it to be triggered by the action of the first automation. Thus, narrowing down the issues to the Team's specific release and emailing only that team's released Issues.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2021

Thanks for that explanation, and here are more exploratory questions.  :^)

  1. Are the different teams working in one or multiple projects in Jira?  If in one project, how do you distinguish the different teams: label, component, something else?
  2. What is the scope of this rule: at a project level or global for all projects?
  3. It seems like each team has their own release version, and that they release independently?  Is that correct?
  4. Who receives the release notes email?  Is it everyone possible, is it a different list of recipients by team, or someone else?
  5. Based upon your answers to 1-4, it appears the challenge is: for a given released version, email the correct/relevant people with the release notes.  Is that correct?

Thanks in advance for your answers!

sarai.makni June 30, 2021
  1. Are the different teams working in one or multiple projects in Jira? One Project
    If in one project, how do you distinguish the different teams: label, component, something else? The text in the fixVersion states which team it is associated to + the date of the release example "Sarai-Team Release 6/30/2021". Cannot use ~ in fixVersion so we place fixVersion in comment when fixVersion is released so we can search the team name from the release title using ~.
  2. What is the scope of this rule: at a project level or global for all projects?
    Project level.
  3. It seems like each team has their own release version, and that they release independently?  Is that correct? Correct. But we use "latestrelease()" in our JQL so if multiple teams release it will simply reference the one in highest order unless we specify the filter using the comment.
  4. Who receives the release notes email?  Is it everyone possible, is it a different list of recipients by team, or someone else?
    It is a list of specific email addresses receiving the list of issues associated to the release. We are not sending the physical release notes.
  5. Based upon your answers to 1-4, it appears the challenge is: for a given released version, email the correct/relevant people with the release notes.  Is that correct?
    For a given released version from a specific team, email the list of issues associated to that release to specific email recipients.
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2021

Thanks, @sarai.makni 

Given what you describe, I suggest you could do this with one rule if you have a known set of teams.  For example:

  • trigger: version released
  • action: lookup issues in the version released with JQL
  • if/else condition: with advanced compare condition: {{version.name}} contains the name of a team A
    • action: email to the team A's audience
  • else if: advanced compare condition:: {{version.name}} contains the name of a team B
    • action: email to the team B's audience
  • and so forth...

 

What do you think?

sarai.makni June 30, 2021

I originally tried this but hit a roadblock at the "contains". I cannot type in a custom value...I have to choose from the list of fixVersions which defeats the contains because there are multiple versions. I want to narrow down to only released versions that start with the specific team name value, otherwise, it is going to return to me every single issue with a released version that looks like the version I selected...

Does that concern make sense? It is extremely possible that I am incorrectly interpreting how the contains in that component works.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2021

Sorry, I am confused...

  • If each team has their own versions to release (from your example: "Sarai-Team Release 6/30/2021"), and
  • that team's issues are marked with their version *only* and no other versions,
  • when that version is released, the issues associated to that fixVersion will only apply for that team.
  • So searching with contains for "Sarai-Team" will only send those issues to that team's email recipients.
sarai.makni July 1, 2021

I understand...but I cannot "Search" in the If-Then block. I only have the option to add every single fix version value for the team (which is quite a lot) and it will return the issues having the entire fix version value name of at least one of the values I select. Per the blue highlighted area, it states, "The field (fixVersion) can contain of these values." It does not say contain any of the string in the value.

Capture2.PNG

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2021

Please try the advanced compare condition I noted above, rather than the simple field condition.  You may then check the smart value from the trigger {{version.name}} to find the relevant team name.

Suggest an answer

Log in or Sign up to answer