# Jira

## Prerequisites

1. An active Decube account with the necessary permissions to configure integrations.
2. A Jira account with administrative privileges or the required permissions to create and manage issues.

{% hint style="info" %}
The authentication credentials is different between Jira Cloud and Jira Data Centre. Please refer to the correct section for required step for each version.
{% endhint %}

## Set up Jira connection

1. Log in to your Decube account and navigate to the **Integrations** tab under **My** **Account** page.
2. Locate the **Third-party** tab on the right side and click on the **Connect to Jira** button, as shown below.

<figure><img src="/files/qlWAISnlbZuY20MGagXJ" alt=""><figcaption><p>Third-party integration</p></figcaption></figure>

3. Select your Infrastructure. There are 2 options, which depend on your organization's Jira setup: Cloud and Data centre.

### **Option 1: Jira Cloud**

<figure><img src="/files/2wiIVOVfEtTUNnuYxRoS" alt=""><figcaption><p>Cloud</p></figcaption></figure>

1. After selecting Jira Cloud option, you will need to provide the **Server URL**. This can be found in your workspace console settings, eg. `https://your-domain.atlassian.net`.
2. You will then need to generate an **API token** from your Atlassian account. This is the [Atlassian guide ](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/)on how to create the API token.
3. Provide the **Jira account email** which was used to generate the API token above.

Once these information is provided, click on `Proceed to connect`

### **Option 2: Data Center**

<figure><img src="/files/kvAau4mbwHFeAzh85zdi" alt=""><figcaption><p>Data Center</p></figcaption></figure>

1. After selecting Jira Data Center option, you will need to provide the **Server URL**. This can be found in your workspace console settings, eg. `https://your-domain.atlassian.net`.
2. You will then need to generate an **Personal Access Token** from your Atlassian account. This is the [Atlassian guide](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html) on how to create the API token.
3. Provide the **Jira Account Username** which was used to generate the Personal Access Token above.

Once these information is provided, click on `Proceed to connect`.

After successful authentication, you will see that the button to Connect to Jira now changes to: `Disconnect` and `Manage`.

<figure><img src="/files/qhR0fhbbpilm9ShgpN86" alt=""><figcaption><p>Jira Credentials Successfully Authenticated State.</p></figcaption></figure>

## Syncing Statuses from Decube to Jira

To Sync statuses from your Jira Project to Decube, Select the "Manage" option.

<figure><img src="/files/Gd4PC0qPco3LjKLAnqRA" alt=""><figcaption></figcaption></figure>

Add a project to begin mapping your Jira Statuses from the selected project to Decube's Statuses.

<figure><img src="/files/cgLjetdLzL9GsIZSVUl4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/y3J64QL1l8KEwQRU9ynA" alt=""><figcaption></figcaption></figure>

Upon Selecting a project, select "+ Map Issue".

<figure><img src="/files/8Kkc9ULUEE7cgckK44wX" alt=""><figcaption></figcaption></figure>

Choose the Issue Type, Issue Status, and the corresponding Incident Status in Decube that you want to map.

<figure><img src="/files/P5b34bF0Tu4e60U33vPD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/LwfjSqcSlm8MgV0K0wtm" alt=""><figcaption></figcaption></figure>

## Adding Jira Sync Webhook to Decube

To sync statuses from Jira to Decube and automatically close incidents, you will need to add following Jira Sync Webhook URL to your Jira account.

<figure><img src="/files/DIBhYGWX6Cnf0OHepryz" alt=""><figcaption></figcaption></figure>

The steps for managing webhooks in your Jira account differs from Jira Cloud and Jira Data Centre. Please refer to the correct guide for each Manage Webhook flow:

1. Jira Cloud: [link to Atlassian documentation](https://support.atlassian.com/jira-cloud-administration/docs/manage-webhooks/)
2. Jira Data Centre: [link to Atlassian documentation](https://developer.atlassian.com/server/jira/platform/webhooks/#registering-a-webhook)

{% hint style="info" %}
You will need to set "**Issues updated**" as the Jira event to be submitted to the Webhook endpoint.
{% endhint %}

## Creating Issues from Decube to Jira

To create an issue in Jira from Decube, go to the Data Quality module and select an incident. In the Incident Details Page, you will find an option to create a Jira issue.

<figure><img src="/files/X3T4FZ6BVp4Mni3ufVGw" alt=""><figcaption></figcaption></figure>

\
In the "Create a Jira Issue" pop-up, the user must fill out the following fields:

* Select a Project (based on the projects previously mapped [here](#syncing-statuses-from-decube-to-jira))
* Choose an Issue Type
* Add an Assignee
* Enter a Summary
* Provide a Description

<figure><img src="/files/NaFgTpTl2lWLqBtKm2KH" alt=""><figcaption></figcaption></figure>

Complete the process by selecting "Create This Issue." You have successfully created an issue from Decube to Jira. You can now view the following details:

* Issue Title
* Issue ID
* Assignee
* Issue Status
* Options to Unlink or Modify the Jira Issue.

<figure><img src="/files/l4KyjNjTBMFunaaRnf0v" alt=""><figcaption></figcaption></figure>

### Modifying a Jira Issue

To Modify a Jira issue, select the "Pencil" icon on the generated Jira Issue.

<figure><img src="/files/QE6q6KKdjnnUk54UeWZE" alt=""><figcaption></figcaption></figure>

Users are allowed to modify the fields below except Projects and Issue Type.

<figure><img src="/files/ZyWh9YgvCZxCGIlnqb30" alt=""><figcaption></figcaption></figure>

### Unlinking Jira Issues from Decube

To unlink a Jira Issue from Decube, select the "Unlink" option from the generated Jira Issue ticket.

<figure><img src="/files/xntykg6iu4yOVNv2VhxA" alt=""><figcaption></figcaption></figure>

On the confirmation prompt, select "Unlink" to unlink you Issue from Decube.

<figure><img src="/files/MLiAbQkmMCikXabYey0c" alt=""><figcaption></figcaption></figure>

When you unlink a Jira issue, Decube will stop syncing any update statuses for that issue. However, you can relink the issue at any time to resume syncing the latest status from Jira.

<figure><img src="/files/jrR3JseegLb9W5v3y82A" alt=""><figcaption></figcaption></figure>

### Disconnecting Jira from Decube

To Disconnect Jira, navigate to My Account > Integrations > Jira and simply select the "Disconnect" option.

<figure><img src="/files/sl1BN83OvKJc0ashXa9M" alt=""><figcaption></figcaption></figure>

Select "Yes, Disconnect" to Disconnect Jira from Decube.

<figure><img src="/files/O45gYogdeULx1xhXDY2q" alt=""><figcaption></figcaption></figure>

When you disconnect Jira from Decube, all generated Jira issue tickets will be revoked. However, you can reconnect to Jira at any time.

<figure><img src="/files/ece825vZ25arwAGfIrm5" alt=""><figcaption></figcaption></figure>

## FAQ

1. **I have marked "Done" on Jira, however it is not syncing to "Close" the incident on Decube.**

First, check that you have correctly mapped the Jira status correctly to the Decube "**Close**" status in the "**Manage Jira Connection**" as in section [#syncing-statuses-from-decube-to-jira](#syncing-statuses-from-decube-to-jira "mention"). You will need to make sure that the right Jira project/space is mapped correctly for which project/space you want to create the issue on.

If the above was done correctly, then you should check if the Webhook endpoint was set up correctly in Jira by following the section for [#adding-jira-sync-webhook-to-decube](#adding-jira-sync-webhook-to-decube "mention").


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.decube.io/collaboration/jira.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
