---
title: "Close package in case all issues in the package are closed"
canonical: "https://help.releasemanagement.app/space/RMC/2926084097/Close%20package%20in%20case%20all%20issues%20in%20the%20package%20are%20closed"
format: markdown
---
> Macro (include)

# Troubleshooting?

> ℹ️ Have issues running Release Automation rules? Please check our troubleshooting guide - [https://releasemanagement.atlassian.net/wiki/spaces/RMC/pages/2522284033/Release+Automation+for+Jira+Triggers+Conditions+Actions#%F0%9F%86%98-Troubleshooting-Automation-Rules](https://releasemanagement.atlassian.net/wiki/spaces/RMC/pages/2522284033/Release+Automation+for+Jira+Triggers+Conditions+Actions#%F0%9F%86%98-Troubleshooting-Automation-Rules).

# Topics

> Macro (toc)

# Step 1. Prerequisites

**Obtain board ID**

![image](media://65ab0c4b-9e9f-43d7-ba08-fb64276591c9)

**Obtain destination package ID:**

*Open the API tab of the board *

![image-20240902-121717.png](media://ca2ffab4-a0e6-4b23-bdb9-24df30b08d57)

*Execute Get Board method:*

![image-20240902-121840.png](media://293ad1f9-2231-4794-941b-bdb01f33173d)

*Locate ID of the package destination column ID:*

![image-20240902-122202.png](media://bc2cb47c-cefe-442a-b83e-81b891e22810)

*Create API Token and generate BASE64 encoded string: *[https://releasemanagement.atlassian.net/wiki/spaces/RMC/pages/2445246483/Swagger+Rest+API+Integrations#How-I-can-get-a-JWT-token-to-access-API%3F](https://releasemanagement.atlassian.net/wiki/spaces/RMC/pages/2445246483/Swagger+Rest+API+Integrations#How-I-can-get-a-JWT-token-to-access-API%3F)

You now have all the pre-requisites you need.

# Step 2. Create Jira Automation rule

*Open Jira Automation and create a new rule. *

*Add new trigger “When Issue is transitioned“. *

In my case, the rule will be started when the issue will be moved to Done.

![image-20240902-112252.png](media://0530abcd-d513-4ae7-ab1f-cccc92f7681e)

In my case, I have also added condition the the rule should react on tasks only but this step might be optional.

![image-20240902-112448.png](media://762ebd5e-47c7-4fe5-a28a-68c4dd0c1c9d)

## Step 2a. Obtain API Access Token

[https://releasemanagement.atlassian.net/wiki/spaces/RMC/pages/3168108545](https://releasemanagement.atlassian.net/wiki/spaces/RMC/pages/3168108545) 

## Step 2b. Get all packages for the version of the issue that triggered the event 

*Send the following request*

**Method** GET

**URL**:[https://rmcloud-prd.releasemanagement.app/api/1/board/642c78f609c486ce9277a562/version-details/{{issue.fixVersions.id}}](https://rmcloud-prd.releasemanagement.app/api/1/board/642c78f609c486ce9277a562/version-details/%7B%7Bissue.fixVersions.id%7D%7D)

**Body**: Empty

Open Headers and add header

> ***X-RM-Token:**** <personal_token_body>*

> ⚠️ At the same time, the Authorization header should be removed from the request if used.

![image-20251113-131726.png](media://22fb1c87-6075-4692-bdba-00da5e2c66fd)

 

## Step 2c. Add new Webhook request and create a new branch after that

![image-20240902-120316.png](media://a140f985-b2dc-4556-901b-2b203e13d8a8)

**Method** GET

**URL**:[https://rmcloud-prd.releasemanagement.app/api/1/board/<your_board_id>/version-details/{{issue.fixVersions.id}}](https://rmcloud-prd.releasemanagement.app/api/1/board/%3Cyour_board_id%3E/version-details/%7B%7Bissue.fixVersions.id%7D%7D)

**Body**: Empty

Open Headers and add header

> ***X-RM-Token:**** <personal_token_body>*

> ⚠️ At the same time, the Authorization header should be removed from the request if used.

## Step 2d. Add Branching settings

**Smart value:** *{{webhookResponse.body.packages}}*

**Variable name: ***currentPackage*

![image-20240902-120631.png](media://d861cdc7-cd5c-4ced-865e-aaa2ed7bb053)

## Step 2e. Make a call to move the package

*Add Send Web Request action*

**Method** PUT

**URL: **[https://rmcloud-prd.releasemanagement.app/api/1/package/{{currentPackage.id}}/move?columnId=<destination_column_id>](https://rmcloud-prd.releasemanagement.app/api/1/package/%7B%7BcurrentPackage.id%7D%7D/move?columnId=%3Cdestination_column_id%3E)

**Body**: Custom data

*{"packageIds":[]}*

Open Headers and add header

> ***X-RM-Token:**** <personal_token_body>*

> ⚠️ At the same time, the Authorization header should be removed from the request if used.


**Activate the rule and test it.**

> Macro (include)