Forums

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

How do I send an email to all Assignee(s)

Zaldy Parian
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.
February 16, 2023

Hi all,

Hope someone could help me with my problem.

I got an automation that uses Lookup issues action. The resulting list of issues from a filter is included in the body of the email presented as a table; which includes a column for {{issue.assignee}}.

I wanted to get the collection of Assignee(s) and put the list into the To field of Send email action

How do I get the list of Assignee(s) as recepient of the email. I don't want to send individual email for each issue as it will become too noisy -- e.g., an Assignee could have 4 issues, which will result to receiving 4 separate emails. 

I tried adding Assignee and issue.assignee, but the email was being sent to myself.

Cheers.

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
February 20, 2023

Do you need to send the entire list to every assignee, or is it enough to send to each assignee just the list of issues assigned to them?

If the latter is an acceptable alternative, you could do something like this:

  • action: lookup issues with your JQL
  • advanced compare condition to check if {{lookupIssues.size|0}} is > 0
  • advanced branch: on {{lookupIssues.assignee.accountId.distinct}}
    • action: lookup issues with your JQL plus assignee = the branch variable
    • advanced compare condition to check if {{lookupIssues.size|0}} is > 10
    • action: send the email, referencing {{lookupIssues.first.assignee.displayName}}
Zaldy Parian
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.
February 20, 2023

Hi Trudy,

Thanks for your suggestions.  I will try it and see if that's a viable option.

Main reason I wanted send the entire full list of issues in one email is because the email is also being sent (as Cc) to the Change Manager; i.e., it will be a bit noisy if I send it to every assignee + the Change Manager. In short if the result of the JQL filter have 5 issues in it and also 5 distinct assignees;  although the assignee will receive only 1 email each, the Change Manager will receive 5 emails.

Is there a way to assign to a temporary variable (or buffer) the Assignee as it loops through #lookupissue... Then use that variable on the To field of an email? I tried the Create variable action, but I could not make it work. :-( 

Zaldy Parian
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.
February 20, 2023

Hi @Trudy Claspill ,

Can you please let me know how i set this up?

  • advanced branch: on {{lookupIssues.assignee.accountId.distinct}}
    • action: lookup issues with your JQL plus assignee = the branch variable
    • advanced compare condition to check if {{lookupIssues.size|0}} is > 10
    • action: send the email, referencing {{lookupIssues.first.assignee.displayName}}

If you can give me an example or screenshot, that would be super.

 

Cheers.

Trudy Claspill
Community Champion
February 21, 2023

Hello @Zaldy Parian 

I pulled that from the Answer on this post. If you look through the comments in the answer you will find screen images and additional information. 

(credit to @Bill Sheboy )

Zaldy Parian
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.
February 21, 2023

Thanks, @Trudy Claspill .
It doesn't really resolve my problem, but it's nice to keep it for future use.
Have a great day, mate.

Trudy Claspill
Community Champion
February 21, 2023

The post I referenced says to use

{{lookupIssues.assignee.displayName}}

in the To field of the Send Email action to specify the recipient.

Using the distinct function will get you the list of distinct values for a field over a list of issues. That can be used to iterate on those distinct values or you can use the list as is.

I think to get all the unique assignee names as a single you could use this in the To field:

{{lookupIssues.assignee.displayName.distinct}}

Like Zaldy Parian likes this
John Funk
Community Champion
April 3, 2023

Hi @Zaldy Parian  - Did adding the distinct solve your problem?

Zaldy Parian
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.
April 3, 2023

Hi John,

Thanks for your follow-up message. I really appreciate all the help/suggestions from this community page.  With the distinct keyword, it does help. I can see the right list in the Audit Log of the automation. However, if the same is put in the To field of the email, somehow it doesn't work.

What I did as a workaround is to create a custom field (which I hid in create/view/edit screen) and add another automation with If/Else components that will pick the Assignee and copy it to the custom field if it satisfy the condition; else, pick the Remote Assignee and copy it to the custom field.   Then in my automation to email the list, I just add the custom field in the To field.

I know it a long way workaround, but I does work for me ;-) 

 

Cheers. 

Like John Funk likes this
John Funk
Community Champion
April 4, 2023

Great! Glad you found a way to make it work. If you could write up your exact use case in as succinct a way as possible, I will pass it along with Automation folks with Atlassian to see if they might develop a good example use case. 

Suggest an answer

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

Atlassian Community Events