How to send emails Approvers of Jira release using Automation for Jira
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
Currently, when a user is added as one of the approvers to a Release, the approver isn't notified at all. There are no notifications about it within Jira, and no emails are sent. This can cause problems as if an approver was added, their attention is required, but they won't be notified about it, unless a user manually informs them, which is not practical. This article will help solve this use-case using the Automation for Jira and we can send out email notification to the approver.
Environment
Jira Cloud.
Solution
Rule configuration
The automation rule will be configured like this:
Add the Version updated trigger.
- Add a Send Web Request action with the following settings:
- Web request URL: https://sitename/rest/api/3/version/{{version.id}}?expand=approvers
- HTTP method: GET
- Web request body: Empty
- In the Headers (optional) section, please add the header key Authorization and the value will be the API token encoded to Base64. Please follow instructions mentioned in https://community.atlassian.com/t5/Jira-Software-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828
- Add an Advanced branching branch, (basically a smart values branch) with the following settings:
- Smart value:
{{webResponse.body.approvers.accountID}}
- Variable name: app
- Smart value:
- Add another Send Web Request action with the following settings:
- Web request URL: https://sitename/rest/api/3/user?accountId={{app}}
- HTTP method: GET
- Web request body: Empty
- In the Headers (optional) section, please add the header key Authorization and the value will be the API token encoded to Base64. Please follow instructions mentioned in https://community.atlassian.com/t5/Jira-Software-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828
- Add the action of Send e-mail with the following settings:
- To:
{{webResponse.body.emailAddress}}
- Subject: Any subject of your choice.
- Content: Any content of your choice.
- To:
The automation rule will look like this: