We are using a custom field (Paragraph or Text type) to store one or more recipient email addresses for automation-triggered notifications.
The automation's "Send Email" action works perfectly when the field contains a single email address. However, it fails when the field contains multiple, comma-separated addresses, with an error indicating the recipient address wasn't provided.
We have tried several smart value approaches to split and parse the string, but none have successfully delivered the email to all recipients. Our testing has included:
{{#issue.Email_ID.split(";")}}{{this.trim}}{{/issue.Email_ID.split(";")}}
{{#issue.Email_ID.split}}{{this.trim}}{{/issue.Email_ID.split}}
{{#join}}{{issue.Email_ID}}{{","}}{{/join}}
{{#replace}}{{issue.Email_ID}}{{" "}}{{","}}{{/replace}}
Example Field Content:
example1@test.com, example2@test.com, example3@test.com
Please provide guidance on the correct smart value syntax to use in the "To" field of the Send Email action to successfully send to all addresses in this comma-separated list?
First, there is no "this" smart value for an unnamed list element in smart values. Where did you find that defined? Instead, there is the explicit {{.}} one or the implied one for chained functions.
And, your use of the chained text functions is incorrect, and you seem to be trying arbitrary syntaxes. Please pause to review the documentation for text and list functions:
Next, your example shows the email address values delimited by comma-space, but your smart value expression is splitting on semicolons. Which is it?
Finally, you note the field named Email_ID. Have you confirmed that is the correct smart value for the field? Smart values are name, spacing, and case-sensitive, and they do not always match the displayed name on the work item views. To confirm the smart values (or custom field id), please use this how-to article:
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Assuming the field's smart value is Email_ID and the value is delimited by commas or comma-spaces, this expression would return a list for use in the Send Email action, with the distinct function added to the end to prevent any duplicates:
{{issue.Email_ID.split(",").trim.distinct}}
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.