---
title: "Send email while moving the version"
canonical: "https://help.releasemanagement.app/space/RM4J/3093692417/Send%20email%20while%20moving%20the%20version"
format: markdown
---
> Macro (include)

# Topics

> Macro (toc)

# Introduction

This is a step-by-step guide on how to send an email when the version is moved on the board.

# Step 1: Obtain Token

Go to [https://releasemanagement.atlassian.net/wiki/spaces/RM4J/pages/1081347#How-I-can-get-a-Token-to-access-API?](https://releasemanagement.atlassian.net/wiki/spaces/RM4J/pages/1081347#How-I-can-get-a-Token-to-access-API?) section to learn how to generate token and [https://releasemanagement.atlassian.net/wiki/spaces/RM4J/pages/1081347#How-to-execute-calls-to-our-APIs?](https://releasemanagement.atlassian.net/wiki/spaces/RM4J/pages/1081347#How-to-execute-calls-to-our-APIs?) section to learn how to make calls to our Rest API.

> ℹ️ Find out more about personalized tokens here [https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html).

# Step 2: Create a Jira Automation rule 

The Jira automation rule could be created in a project context or as a Global rule.

In our case, let’s investigate an option with Global rule creation. 

Open Global rules configuration: <https://your_jira_url/secure/AutomationGlobalAdminAction!default.jspa#/>

Create a new rule:

![image-20241206-090237.png](media://789eb2b4-3366-4efe-8f93-5198e1ecbd11)

Add “Incoming Webhook trigger“ and store incoming webhook URL

![image-20241206-090434.png](media://5cb3c464-5e40-4927-bab2-9a090d277905)

Let’s imagine we would like to send an email to the person who would like to see the destination column the release has been moved on, the release name, and the person should be provided with the link to open the release and approve it.

Add an action “Send email“:

![image-20241206-091309.png](media://b6b5a236-c24b-493e-8cc8-5ba3e94ab8fe)

The variables that should be sent from Release Management to be defined in the format ***“{{webhookData.VARIABLE_NAME}}" ***where VARIABLE_NAME is any string. 

In the next steps, we will map the variable name with actual values.

**Save **the automation rule and activate it.

# Step 3: Create a Release Management webhook 

Create new webhook

![image-20241206-095632.png](media://b1ac9ee6-eec2-4b30-93d6-fdd1fbf68000)

Select columns that should be triggering the webhook (email sending)

Select hook type POST and paste the URL from the previous step.

Put to the body the following text (JSON)

```
{"data":
{
"versionId":"{{entity.id}}",
"versionName":"{{entity.name}}",
"destinationName":"{{destinationColumn.name}}",
"linkUrl":"https://YUOUR_JIRA_URL/secure/release-management.board.jspa?id=BOARD_ID&version={{entity.id}}#versions"
}
}
```

In this JSON there is a mapping of the values:

All the data should be added to the data block

```
{"data":
{
 "paramaterNameInJiraAutomation": "value to be send from Release Management"
}
}
```

`"versionId":"{{entity.id}}` - sending version Id from RM variable `{{entity.id}}`

`"versionName":"{{entity.name}}"` - sending version name from RM variable  `{{entity.name}}`

`"destinationName":"{{destinationColumn.name}}"` - sending destination column name from RM variable `"{{destinationColumn.name}}"`

`"linkUrl":"https://YUOUR_JIRA_URL/secure/release-management.board.jspa?id=42&version={{entity.id}}#versions"` - constructing URL to the release where

- `"linkUrl"` - name to be sent to Jira automation
- `https://YOUR_JIRA_URL/secure/release-management.board.jspa?id=BOARD_ID&version={{entity.id}}#versions` - URL template where we would need to specify
  - `YOUR_JIRA_URL` - Jira URL
  - `BOARD_ID` - board ID

> Macro (include)