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.