> ## Documentation Index
> Fetch the complete documentation index at: https://docs.refold.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Building a Jira integration

> This tutorial will give an example of how to create a Jira integration that creates an issue from your app to your Linked account's Jira Project.

## Pre-requisites

1. Jira App is enabled in Refold.
2. Jira OAuth app credentials added to Refold. Refer [here](https://docs.gocobalt.io/resources/integration-providers/jira#creating-an-app-in-jira).
3. Trigger created in Refold. Refer [here](https://docs.gocobalt.io/guides/workflow/triggers).
4. Linked Account available. Refer [here](https://docs.gocobalt.io/guides/platform/linked-account).

## Building a Workflow

We'll create a Jira Workflow in Refold which can create an issue in a Project given by the user. For this, we'll first find the project based on it's name and then create an issue in it.

#### 1. Create Workflow in app

* Go to your [`Apps catalog`](https://app.gocobalt.io/apps) in **Refold** > Search for `Jira` > `Workflows` > `Add Workflow` > Choose `Manually` > Give it a name and click on `Add Workflow`.

<img height="200" src="https://mintcdn.com/cobalt-55/0IGKzTphHY-auv_h/images/Jira/jira_workflow.png?fit=max&auto=format&n=0IGKzTphHY-auv_h&q=85&s=87b293211837dd9fb265226469cb8c95" alt="Navigation for Workflow setup" data-path="images/Jira/jira_workflow.png" />

#### 2. Adding the Trigger

To add a trigger for a Workflow in Refold, you need to select details about the Trigger like the Type and which trigger to be implemented.

To add a Trigger, follow these steps:

* Click on the **Start node** to add a trigger.
* In the right side, select the **Type** and the **Trigger** and click on the `Add Trigger` button.

<img height="200" src="https://mintcdn.com/cobalt-55/0IGKzTphHY-auv_h/images/Jira/jira_start.png?fit=max&auto=format&n=0IGKzTphHY-auv_h&q=85&s=1a61e9a361505a3fe6a99fb88ebdde3e" alt="Start Node Trigger" data-path="images/Jira/jira_start.png" />

For this Workflow, we have created an Event `Details of Issue` which contains the payload like the project name, issue description, priority etc. about the event sent by you to Jira.

#### 3. Adding the Jira Action

* From `Actions`, add a Jira node to the workflow.
* Click on the node and select an Action from the `Choose an Action` dropdown menu.
* Choose the **List Projects** Action to get a list of all the projects in Jira.
* Next, use a **Transform Node** to find the Project ID based on the Project Name.

<Tip>
  Learn more about the Transform Node [here](https://docs.gocobalt.io/guides/workflow/transform).
</Tip>

* Add another Jira node, choose `Create Issue` as the Action and provide the required fields like Project ID, Issue-type ID etc. and click on `Save`.

<Warning>
  Before clicking on `Save`, make sure that you have entered data for all the mandatory fields whichever required.
</Warning>

<img height="200" src="https://mintcdn.com/cobalt-55/0IGKzTphHY-auv_h/images/Jira/jira_action.png?fit=max&auto=format&n=0IGKzTphHY-auv_h&q=85&s=7336ef5d7c8898de9616ca1421e2447d" alt="Jira Node" data-path="images/Jira/jira_action.png" />

* Connect all the nodes by clicking on `+` button on the node and dragging the arrow to the **Jira** node.

#### 4. Publishing the Workflow

* To publish the workflow, click on the `Publish` button in the top, **Select Environments** of the Workflow and click on `Publish`.

<img height="200" src="https://mintcdn.com/cobalt-55/0IGKzTphHY-auv_h/images/Jira/jira_publish.png?fit=max&auto=format&n=0IGKzTphHY-auv_h&q=85&s=6cf8d8d386ccebe7fe284c75d9a53915" alt="Publish Workflow" data-path="images/Jira/jira_publish.png" />

## Enabling the Workflow

To enable a workflow, end user or a Linked Account needs to Toggle On the Workflow after connecting with the application.

* Navigate to the Linked Account in which the Workflow needs to be enabled by getting its' **Hosted URL**.

<img height="200" src="https://mintcdn.com/cobalt-55/JZIwRzAqkgW8vPoP/images/Salesforce/Salesforce_linked.png?fit=max&auto=format&n=JZIwRzAqkgW8vPoP&q=85&s=299ceef4856775339eefb9415723bb55" alt="Navigate to Linked Account" data-path="images/Salesforce/Salesforce_linked.png" />

* Go to the Hosted URL and select **Jira** from `Manage your Integrations` list.
* Click on the `Connect` button > Review the permissions and allow them for a successful connection.

<img height="200" src="https://mintcdn.com/cobalt-55/0IGKzTphHY-auv_h/images/Jira/jira_enable.png?fit=max&auto=format&n=0IGKzTphHY-auv_h&q=85&s=fb393827e34064ebb7672284043b1979" alt="Enable Workflow in Linked Account" data-path="images/Jira/jira_enable.png" />

* After a successful connection, you can see the `Configure` section in the Pardot Application page.
* Enable the Workflow **Create Issue** by turning the **toggle On** and click on `Save`.

## Fire an App Event

Lastly, we'll fire an App Event whenever a contact is created in your app by using the Workflow.

* Navigate to `Try API` in **Refold**.
* Choose the **Linked Account** created to test the workflow, select the **Event** and Jira as the **Application**.
* Click on the `Fire Event` button in the top right.

<img height="200" src="https://mintcdn.com/cobalt-55/0IGKzTphHY-auv_h/images/Jira/jira_fire.png?fit=max&auto=format&n=0IGKzTphHY-auv_h&q=85&s=7029f0e4700073d941ac3704821de16b" alt="Fire an App Event" data-path="images/Jira/jira_fire.png" />

* You can check the status of the event by navigating to `Logs` > `Events` in **Refold**.

Congratulations! We have successfully built a Jira integration that creates an issue from your app to your Linked account's Jira Project.
