Automation || When a user is added to a multi-user picker field, only the newly added user should receive the email notification

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

When a user is added to a multi-user picker field which may have existing users already, then only the newly added user(s) should receive email notifications via Automation for Jira.

Solution

Here is the rule snippet:

Rule to send email to new user in user-picker field using automation

Details:

  • Trigger

    : When the field value changes for the Multi-user picker field This would pick up any changes made to the user picker custom field

  • For-each branch: Use a for-each branch to iterate over each added user considering there might be more than 1 user added to the user picker field. Here is the smart value for the "For-each" branch:

{{addedfieldChange.valueIds}}
  • Inside the "For-each" branch, use the send web-request action to fetch the email address of the newly added user:

    https://<instance>.atlassian.net/rest/api/3/user/bulk?accountId={{user}}

  • Headers:

Authorization: Basic <Encoded Base64 emailId:API token>Content-Type: application/jsonHTTP method: GETRequest body: Empty
  • Please ensure to use the base64 converted value of your Atlassian Account "email address:API token"

  • Action: Send Email - use the below smart value in the "To" section:

{{webhookResponse.body.values.emailAddress}}

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.