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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can't generate user's email addresses

I am trying to create an automation rule for a template I'm creating that automatically send users in a custom field an email.  

When an issue is transitioned in my automation rule i select the the "Send Email" component.  In the To: box I entered this code to generate the user's email addresses taken from the users in a custom user field called "Stakeholders".  

{{issue.Stakeholders.emailAddress}}

I don't know why this doesn't generate the user's email addresses found within my user field called Stakeholders.  

When I type in 

{{issue.Stakeholders.displayName}} it works just fine so I know "Stakeholders" is being recognized.  

 

Any ideas?  

3 answers

1 accepted

2 votes
Answer accepted

There is an open defect that team-managed project custom fields do not expose/return the email address (I am guessing through the API) to the smart values:

https://codebarrel.atlassian.net/browse/AUT-1830

 

It's a bug so this is unresolvable currently.  

2 votes
John Funk Community Leader Jun 29, 2021

Hi Christian - Welcome to the Atlassian Community!

Why type of field is the Stakeholders custom field? 

It is a multiuser user picker.  

Not sure this will work, but might be worth a try. So I would think this would send an email to each person in the list.

{{#issue.Stakeholders}} ({{emailAddress}}) {{/}}

What I am not sure about is if there needs to be some type of separator between them. 

OR if this functionality will even work in the TO field of an email for a multi-select field. 

I've tried something similar but user isn't the name of the custom field, "Stakeholders" is so doesn't seem to do anything.  

One other thing to note is that this is a Team Managed project and not a company managed project.  Not sure if that makes a difference.  In the TO: box for the create email action there are certain fields like Reporter and Assignee that when selected they do generate the email addresses.  It's only when I try and target the users in a custom field that it doesn't work.  

Hi @Christian simpson 

John has you on the correct track, and I suggest a small adjustment to add semicolon delimiters, except for the last value in the list:

{{#issue.Stakeholders}} {{emailAddress}} {{^last}} ; {{/}} {{/}}

But first, have you confirmed that value is the correct smart value of your field name?  You may check that with the information in this how-to article:

https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

Best regards,
Bill

Like John Funk likes this

Thanks for the suggestion Bill, unfortunately it did not return their email addresses.  I wonder if their is no smart value for the field when it's created within a team-managed project versus a company-managed project. 

One way I confirmed that I labeled the field correctly was by testing it this way

{{issue.Stakeholders.displayName}}  and that does return the display names of everyone with the "Stakeholders" field so I know I referencing it correctly. 

Interesting... that is why I was suggesting that how-to article.  Basically you find an example issue which has your data, look it up with the REST API...

https://<yourinstanceurl>/rest/api/2/issue/<issuekey>?expand=names

And then search for your data and field name.  If it is present, the smart value probably will work.

UPDATE: oops, and sorry for the bad guidance, as there is an open defect that team-managed project custom fields do not expose/return the email address (I am guessing through the API) to the smart values:

https://codebarrel.atlassian.net/browse/AUT-1830

Like # people like this

OK I will look into that more, thank you.  

Like John Funk likes this

Ahhhhh ok, well at least I'm not crazy lol!  Thank you for at least giving me some kind of resolution on the issue.   

Like # people like this
1 vote
Jack Community Leader Jun 29, 2021

I haven’t used stakeholders before. I went to the documentation for Smart values but I didn’t see stakeholders. I assume you have validated it? I see your last comment seems to indicate it’s valid but my question is does it actually produce results?

Sorry "Stakeholders" is a custom multi user field I created.  It's populated with a set number of users I would like to send emails to but I can't seem to figure out how to generate their email addresses.  Other things seem to work just fine like displayName for example.  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Jira

⏰ Day in the life of a Jira Admin!

Hello Community! We thoroughly enjoyed this just-for-fun conversation in the Jira Admin Group about what it's like to be a Jira Admin. For #JiraJuly, our talented designers created these graphics t...

931 views 2 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you