Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,633
Community Members
 
Community Events
184
Community Groups

Jira Automation - Get the User email from the User Id

We are building an automation as explained in this post here.

After managing users in a list to get them only once, we just remain with the User Id information.

Now we need to send them an email, but we didn't find any API to retrive the email of the user from the Id.

Do anyone has an advice?

1 answer

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2023

Hi @albanoandrea 

Can you share your rule here? Are you using the .emailAddress function at the end of the field?

We can't use emailAddress function because after we manage the list of user we lose everything except the user Id.

I didn't want to make the question too heavy since the same automation is in the linked posto, anyway here on a copy of the current automation.

As you can see at the end printing {{distinctWatchers}} print the user id, while printing {{distinctWatchers.emailAddress}} doesn't print anything.




After each step I'm sending an email to me to verify that the variables are ok.
after_rule1.pngafter_rule2.png

Since there are 3 jiras with 2 different watcher only, the variable varWatcherList is an array with 3 elements.

after_rule2_email.pngafter_rule3.png

After the second step the 2 watcher are correctly extracted.

 

after_rule3_email.png

In the second part of the jira I want to dinstict the watcher.

 

after_rule4.png

For every watcher I send to me this email, but the emailAddress and displayName is empty 

after_rule5.png

Here the result for the 2 watchers.

after_rule5_email1.pngafter_rule5_email2.png

So, what I miss is to extract the email address because the last step is this:
after_rule6.png

And emailAddress is always empty.

Suggest an answer

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

Atlassian Community Events