Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Send an e-mail to issue watchers when certain criteria is met

Artur Balyan _ Immedis
Contributor
July 9, 2024

Hello,

I want to send an email to people who have chosen to watch certain issues and to notify them when the issues reach a certain status.

I am using this structure:

Screenshot 2024-07-09 144926.png

 

I saw this from this article: 

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#:~:text=%7B%7Bissue.watchers.emailAddress%7D%7D%20%2D%20Returns%20the%20watcher%27s%20email%20address.

If this {{issue.watchers.emailAddress}} returns the watcher's email address shouldn't that rule send an email to all watchers by putting this smart value in the email address line. I also tried {{#issue.watchers.emailAddress}}{{/}}.

 

I get an error and no e-mails are sent over. The rule returns at least 1 item and I made sure that I am added as a watcher.

Screenshot 2024-07-09 145739.png

 

Any insight would be appreciated.

Thank you,

Artur

2 answers

2 votes
Walter Buggenhout
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 9, 2024

Hi @Artur Balyan _ Immedis,

You are using {{lookupIssues}} to retrieve multiple issues and then use {{issue.watchers.emailAddress}} as a smart value to retrieve the To email address(es), but you have not specified / initiated an issue in your rule. That is why there is no email address found.

You could retrieve a list of unique email addresses through a lookup Issues action and then add a branch to your rule For each / Smart value, sending the email to each email address.

As an alternative, if you could also use a filter subscription to send email notifications. That is a lot easier to use, does not impact your automation rule limit for your site, but has 2 limitations against your current approach:

  • you cannot customise the email itself
  • you would be sending the email to a fixed set of users

I suppose the amount of effort you should put into this relates to the desired outcome you're trying to achieve ...

Hope this helps!

Artur Balyan _ Immedis
Contributor
July 9, 2024

Hello Walter,

Thank you for the reply! I assumed that it would at least pick up one watcher and started to think that there is an issue with the smart value. 

I'll try what you suggested with retrieving the email addresses.

bduncan
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 9, 2024

+1 Walter, branching should get you there to process through each returned issue.

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 9, 2024 edited

Hi @Artur Balyan _ Immedis 

Adding to the other suggestions offered...

The watchers field is a list of users, and when this smart value expression is used in the Send Email action's To field:

{{issue.watchers.emailAddress}}

By default, it joins them with commas.  However, the Send Email action uses a semicolon delimiter between email addresses.  To solve this, please select that specifically with the join() function instead:

{{issue.watchers.emailAddress.join("; ")}}

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events