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

Tyler Burton 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 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 April 2, 2024

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

Like Bill Sheboy likes this
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 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