Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation: how to use "send email" when a smart value has more than one email?

Pedro Paulo de Freitas Junior November 12, 2025

I have the following expression to capture a list of emails based on the last comment:

{{#issue.comments.last.body.match("([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})")}}{{.}}, {{/}}

Example:

Comment: email: xpto@xpto.com --> Result: xpto@xpto.com

Comment: email: xpto@xpto.com and abc@abc.com --> Result: xpto@xpto.com, abc@abc.com, 

Comment: email: xpto@xpto.com, abc@abc.com and xyz@xyz.com --> Result: xpto@xpto.com, abc@abc.com, xyz@xyz.com,

I am putting the result inside a variable called "emailList".

This smart value is being added as the "To" in the send email action.

In all cases, the action status is "SUCCESS", but when there are two emails, no one receives the email. Only when there is 1 email or 3 (or more) does it work.

 

1 answer

0 votes
Valerie Knapp
Community Champion
November 12, 2025

Hi @Pedro Paulo de Freitas Junior , thanks for your post.

Here,

{{#issue.comments.last.body.match("([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})")}}{{.}}, {{/}}

You are specifying only the latest / last comment, correct?

Why would there be more than one email address? I am curious.

Are you logging the results of the smart value?

Please share some screens of the rule configuration and the audit log of your tests so we can see better what you are doing and how you are doing it.

Best wishes 

Suggest an answer

Log in or Sign up to answer