Automation - send email to all users listed in custom People field

Tyler Burton
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 16, 2021

I have a custom field "QA" on tickets. It is a people field, allowing the ticket creator to add multiple JIRA users to the field.

I'm trying to use automation to send emails to all people in the QA field when a specific action occurs. On the automation event, I cannot select the QA field in the "To:" box.

I've tried using smart fields like {{issue.customfield_10344.emailAddress}} to set the email recipients, but it still doesn't work. Any tips?

QA field.png

 

automation - send email.png

2 answers

1 accepted

0 votes
Answer accepted
nmenere
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 27, 2021

Hi Tyler,

Unfortunately we don't have support for this field yet (People field in NextGen projects).

This issue is being tracked at:

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

 

Cheers,
Nick Menere [Head of Product Automation]

Jiri Komarek
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!
January 13, 2022

Any plans to make this happen? For me, it is quite an important feature. 

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.
January 13, 2022

Hi @Jiri Komarek -- Welcome to the Atlassian Community!

I was curious about this one and so retested it...Short version: it still doesn't work

Longer version:

  • According to this how-to for finding the smart values for a field, the emailAddress of People fields for a team-managed project is available to the REST API: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
  • But, when that type of field is checked in an automation rule only some of the attributes are available, and emailAddress is not one of them
  • A complex work-around is possible using the REST API...depending upon how many values are in your field
    • Get your people field, and get the accountId values, and create an advanced branch loop on them
      • Call the REST API using a web request to get the user.  This could take a second or more per call to the REST API.
      • Get the emailAddress from the response
      • Send your email

Kind regards,
Bill

Like Adam Hopkins likes this
Adam Hopkins
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!
April 2, 2024

I can confirm that this workaround works. Roundabout, but effective.

Like Bill Sheboy likes this
Nur Fatin September 22, 2024

Hi, I am also facing the same issue. Could anyone share the workaround for this? I need to get Automation - send email to all users listed in custom People field too. Mine is a team-managed project.

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.
September 23, 2024

Hi @Nur Fatin -- Welcome to the Atlassian Community!

For team-managed projects, the People field type still does not provide the email address to automation rules.  Here is the open suggestion to add that: https://jira.atlassian.com/browse/AUTO-519

The two possible workarounds are noted above:

  • Ask your Jira Site Admin to add a user-picker field at the global level (i.e., for company-managed projects, CMP), and then use that field instead in your team-managed project (TMP).  Atlassian added this ability so TMP could reuse the CMP fields.
  • If you keep your People field in the TMP, the rule could call the user lookup REST API using the Send Web Request action to get the email address.  This approach may not work for your case if there are multiple users selected.

Kind regards,
Bill

Like Nur Fatin likes this
Nur Fatin September 25, 2024

Thank you @Bill Sheboy

Is this a limitation of team-managed projects?

Out of curiosity, if the project is a company-managed project, the automation - sending email to users listed in custom People field will work?

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.
September 26, 2024

As I understand it, People fields are only used by team-managed projects, including software, Jira Product Discovery (JPD), and Jira Work Management (JWM) types.  The missing information such as email address is a limitation of the People field type.  

That appears to be one of the reasons Atlassian added the ability to share global, company-managed fields for use with team-managed projects.

Company-managed projects should not have this symptom of missing data such as the email address for user-picker fields.

0 votes
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.
September 16, 2021

Hi @Tyler Burton 

If that is a multiple select, custom user field, you should see it in the drop down list for TO if the field is available for the project.  If not...

You should be able to type in the smart value in the TO field, it will appear below the field, and then you may select it to add it to the TO field.  So, please try to enter your field, such as {{issue.QA}} or use the relevant custom field ID.

If that does not auto-magically use the email address attribute, you could also try this to explicitly pull out the email addresses into a list:

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

Kind regards,
Bill

Tyler Burton
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 16, 2021

Hi @Bill Sheboy - thanks for the quick response. The "QA" field is a custom field with type: User Picker (multiple users).

When attempting to use the smart value in the TO line, it is not auto-suggesting the field. I've tried using {{issue.QA}} and the actual field ID {{issue.customfield_10344}} but cannot get it to appear.

No success with using {{#issue.QA}}{{emailAddress}}{{^last}}; {{/}}{{/}} either. I ran a test adding this same snippet to the body of the email, and nothing was returned.

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.
September 16, 2021

Hmmm...

Have you tried that same list syntax with your custom field ID?  (I substituted a comma for the semicolon to see if that helps.)

{{#issue.customfield_10344}}{{emailAddress}}{{^last}}, {{/}}{{/}}

And if that doesn't work, perhaps try writing one or more of these values to the audit log to see if it is returning what you expect.

Suggest an answer

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

Atlassian Community Events