Send e-mail to a group with Jira Automation

Jira Guy
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!
July 26, 2024

Hello all

In my JSM project, I have an Asset custom field called Team. It stores multiple objects of type "Team" from the CMDB. Among the attributes of the "Team" object, I have an attribute called "team_members" which stores multiple Jira users.

I'm having trouble building the following automation:

Whenever a new team is added on the ticket, send an e-mail to all jira users stored in the "team_members" attribute.

 

I've tried adding the following smartvalues in the "To:" section of the action:

{{Team.team_members}}

 

{{Team.team_members.accoundId}}

 

{{Team.team_members.emailAddress}}

 

The error I'm receiving is: 

 

Could not send email, the 'To' address field is empty. If you have referenced a field it may be empty.

Any ideas of how I could make it work?

5 answers

3 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2024

Hi @Tudor Tofan,

Welcome to Atlassian Community!

What type is the attribute? User? If that is the case and it accept multiple values then you have to use a branch so that you can iterate over each user in the attribute, similar to this branch that I use to set Business Approvers:

Screenshot 2024-07-26 at 8.39.54 AM.png

I would use {{Team.team_members.emailAddress}} to set the smart value in the branch and then use it in the To field.

1 vote
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.
July 26, 2024

Hi @Tudor Tofan -- Welcome to the Atlassian Community!

First, have you confirmed the asset, smart value contains the information needed?

 

Next, when a list, smart value is referenced like this:

{{Team.team_members.emailAddress}}

By default, it joins them with commas.  However the Send Email action wants multiple values delimited with semicolons.  Perhaps try forcing that with this:

{{Team.team_members.emailAddress.join(";")}}

 

Kind regards,
Bill

0 votes
Victor - Modus Create September 2, 2024

Hi @Tudor Tofan  ,

From what I understood of your request, it seems that you would find an alternative for this using Notification Assistant for Jira Cloud:

https://marketplace.atlassian.com/apps/1211069/notification-assistant-for-jira-email?hosting=cloud&tab=overview

The app allows you to send notifications to multiple users that could help you with the task at hand.

Hope it helps.
Cheers,
Victor | Modus Create

0 votes
Jira Guy
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!
July 26, 2024

Thanks for the suggestions guys. It was actually the problem with the e-mail address visibility. It seems that none of the users from that attribute (including myself), had the e-mail address set as public. As soon as I set my own e-mail address as public, it started working like a charm with 

{{Team.team_members.emailAddress}}

 

0 votes
Jim Knepley - ReleaseTEAM
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 26, 2024

Hi @Tudor Tofan 

You might be able to discover the structure of the smart value for that custom field by using the issue API.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events