If users are added to a user picker field,mention them in a comment using an automation rule.
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
This article describes the steps to create an automation rule to mention users in an issue comment when they're added to a user picker field (Team). This is useful for notifying the users immediately when they're added to a team.
Environment
Jira Cloud
Solution
Rule Details:
Trigger: Field Value Changed: Select the user picker field to monitor.
IF Condition (Optional): Add any additional conditions if required, like the project, issue type etc.
Branch: Advanced Branching
- Smart value: {{issue.customfield_10162}}.
- Variable name: {{user}}
Then: Add Action: Comment on issue
- User [~accountid:{{user.accountid}}] has been added to the field <<Field Name>>.
If we're using a multiple user picker field, the above rule will add a separate comment for each user value added to the field. To add all users in a single comment, remove the Branch and add the below smart values in the "Comment on Issue" action:
{{#issue.customfield_10162}}
- [~accountid:{{accountId}}]
{{/}}
Please replace the custom field ID from your instance and verify the comment visibility before publishing the rule.