Automation to send email only once per assignee
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
Use case: Whenever the issue is due, send only one email to one user even if there is more than one due issue.
Solution
- Create a trigger for Scheduled and update the value based on the requirement. In the below rule, the schedule is set to run every week on Monday. Click on Save.
- Add a new component and select Then: Add an action > select Lookup issues. Update the JQL so the required issues are being lookedup for the next action. Click on Save.
- Add new component with For each: create a branch > Advanced branching > Enter the smart value as {{lookupIssues.assignee.distinct}} and Variable name as distinct. Click on Save.
- Add a new component and select Then: Add an action > enter the JQL used for lookup action previously but also include assignee = {{distinct}} just like shown in the below reference
- Add a new component and select Then: Add an action > select Log action. This is optional. If you would like to review the user details in the audit log.
- Add a new component and select Then: Add an action > select Send email. While updating the To field, make sure to use {{
distinct.emailAddress}}
Click on Save.
Expected results of the above rule
- Users will receive only one email even though there are 3 issues that are due.