Jira Automation - Get the User email from the User Id

albanoandrea May 24, 2023

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?

albanoandrea May 24, 2023

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