Forums

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

Send unique, single email to each user in custom multi-user picker field

Stewart_ Emily _ Global D_T July 13, 2025

I have a customfield_12858 that is a multi-user picker field. I want to send one email per day to each user that is selected in cf[12858], and the email should contain a list of all the work items on which that user is selected in cf[12858]. There should not be any emails sent to multiple users at the same time, even if the multiple users are selected in cf[12858] on the same work item.

I've tried about a million tweaks but cannot get it just right. The following automation is sending me two emails:

1. 1 with a list of the 3 work items on which I'm selected in cf[12858], which is good.

2. 1 to me and another user who are both selected in cf[12858] on one work item, but the email doesn't even list the 1 work item. This email should not be sent at all.

Please see detailed screenshots of the current automation rule, email output, and audit log, and thanks in advance.

image.pngimage.pngimage.pngimage.pngimage.png

image.png

image.pngimage.pngimage.png

1 answer

1 accepted

4 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.
July 13, 2025

Hi @Stewart_ Emily _ Global D_T 

When the rule uses Lookup Work Items on a multiple-selection, user field, that produces a list of lists.  Thus when the distinct function is added, it is checking the sets of selections.

For example, if you had four work items with these user selections:

  1. key=ABC-111, customfield_12858=Alice, Bob
  2. key=ABC-222, customfield_12858=Bob
  3. key=ABC-333, customfield_12858=Eve
  4. key=ABC-444, customfield_12858=Bob

The result of {{lookupIssues.customfield_12858.distinct}} would be [Alice, Bob], [Bob], [Eve]

When you want the individual user selections to be distinct, all the nested lists need to be flattened into one list before distinct is used:

{{lookupIssues.customfield_12858.flatten.distinct}}

Please try that and let me know how it helps.

 

Also, you note this in your question:

There should not be any emails sent to multiple users at the same time, even if the multiple users are selected in cf[12858] on the same work item.

Would you please clarify what you mean by "at the same time"?

 

Kind regards,
Bill

Stewart_ Emily _ Global D_T July 13, 2025

Hi Bill, thanks so much for your prompt and accurate response. It worked as far as I can tell. I'll need to confirm with a couple more people tomorrow but feel confident the word flatten did the trick. Regarding my last comment, I just meant I didn't want an email to be sent to more than one user, so flattening worked perfectly. Thanks again!

Like # people like this

Suggest an answer

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

Atlassian Community Events