Forums

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

Distinct user from multi-user custom field in Jira Automation

Cornelius Schiffer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 6, 2022

Hi all,

I am creating an automation that will send emails to all interested users when a version is released. There is a custom issue field "Notify on Release" that can contain multiple users per issue who should be notified.

I fetched all issues where this custom field is not empty and now need to get a list of distinct users to be notified. If my custom field contained only a single user, I could simply assign this to a new variable: `{{lookupIssues.Notify on Release.distinct}}`, but since my custom field can contain multiple users this will not work.

Example:

  • Issue 1 - Notify on Release: User A, User B
  • Issue 2 - Notify on Release: User A
  • Issue 3 - Notify on Release: User A

This would result in the following list: (User A, User B), User A.

Is there a way to combine all elements in a single list first and then run distinct on them?

Thank you in advance!

1 answer

1 vote
Alex Koxaras -Relational-
Community Champion
September 7, 2022

Hi @Cornelius Schiffer 

Can you try to create a new variable after that lookupissues and assign the value of {{lookupIssues.Notify on Release.distinct}}. Then call the distinct method on the new variable. Log it and see what this yields.

Cornelius Schiffer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 7, 2022

Hi Alex, 

thank you for the answer!

I tried it like this:

Bildschirmfoto 2022-09-07 um 12.26.57.png

The first log shows the users, the second only the static text. My new variable "distinctUsersToNotify" seems to be empty.

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