# Atlassian Jira

{% hint style="info" %}
Open-source and On-premise editions of Ylem require separate specific configurations for this integration. See [below](#configuring-integration-for-open-source-and-on-premise-versions)
{% endhint %}

**Integration type**:  `Write`

Integration with Atlassian Jira allows you to create tickets there in real time based on the streaming events you define in Ylem pipelines.

**Data for the connection:**

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2F1u1nqJrTpSPVE0q1VGdY%2FScreenshot%202024-04-23%20at%2019.18.19.png?alt=media&#x26;token=3492fc40-4aaf-46ab-9f37-9b583db68686" alt=""><figcaption></figcaption></figure>

## Configuring integration for open-source and on-premise versions

If you don't use the cloud version of Ylem but have it installed on your infrastructure under your domain name, you can choose one of the following two ways how to make this integration work.

### Using Atlassian Application and OAuth 2.0

It is the same way how it works in our cloud version. You need to create your own Atlassian Application and integrate your Ylem instance with it so that your users will be able to authorize Ylem to access their Atlassian accounts.

#### Step 1. Create Atlassian Application

As the first step, you need to go to the [Developer Console](https://developer.atlassian.com/console/myapps/) of Atlassian and create your own "OAuth 2.0" application.

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FUIymS08uU04uaIeLtASU%2FScreenshot%202024-09-12%20at%2021.57.17.png?alt=media&#x26;token=acab96e5-7e78-4b8c-a9fa-947fc23f833c" alt=""><figcaption></figcaption></figure>

These are the data and the scopes required for this application to work with Ylem:

<div><figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FKcSHZZrqGVYZ4chBaqPg%2FScreenshot%202024-09-12%20at%2022.01.55.png?alt=media&#x26;token=4ce2c8d0-4259-49b3-af0e-4a519cdb1ee1" alt=""><figcaption></figcaption></figure> <figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FDjLDDMgghLtZcS4cXD1p%2FScreenshot%202024-09-12%20at%2022.03.49.png?alt=media&#x26;token=03c1e3ae-dfc3-4f6e-a074-d668f3d05622" alt=""><figcaption></figcaption></figure> <figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2F7bb9mtMlRUQNo4LE3AEg%2FScreenshot%202024-09-12%20at%2022.03.25.png?alt=media&#x26;token=32e9031d-4c06-48d3-89f9-5ea78234cc88" alt=""><figcaption></figcaption></figure></div>

As soon as the application is ready, you can open its "Settings" and copy your CLIENT\_ID and CLIENT\_SECRET. These two values you will need to add to your Ylem configuration now.

#### Step 2. Configure Ylem .env parameters

The following parameters need to be changed on the `backend/integrations/.env` file:

```bash
INTEGRATIONS_JIRA_OAUTH_CLIENT_ID=%%REPLACE_IT_WITH_THE_CLIENT_ID_OF_YOUR_APP%%
INTEGRATIONS_JIRA_OAUTH_CLIENT_SECRET=%%REPLACE_IT_WITH_THE_CLIENT_SECRET_OF_YOUR_APP%%
INTEGRATIONS_JIRA_AFTER_AUTHORIZATION_REDIRECT_URL=https://%%REPLACE_IT_WITH_THE_DOMAIN_NAME_OF_YOUR_YLEM_INSTANCE%%/jira-authorizations/{uuid}/?justConnected
```

Now you can open **https\://%%YOUR\_YLEM\_DOMAIN\_NAME%%/jira-authorizations** and try to authorize Jira Integration by clicking on the button "**Add Jira authorization**".

### Using API integration, Atlassian API, and PAT

Another way of creating an integration with Atlassian Jira to be able to create issues directly from Ylem is using its REST API with Personal Access Tokens (PAT).

#### Step 1. Create Personal Access Token (PAT)

Personal Access Token (PAT) is a safe alternative to using username and password for authentication with various 3rd-party services like Ylem.

This page contains a detailed explanation of how it can be created:

{% embed url="<https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html>" %}

#### Step 2. Creating API Integration and sending requests to it from Ylem pipelines

As soon as you have your PAT configured, you can use it as an Access Token for POST/GET requests to Atlassian API.

Check [Atlassian REST API reference](https://developer.atlassian.com/server/jira/platform/rest/v10000/api-group-issue/#api-api-2-issue-post) and create a Ylem [API Integration](https://docs.ylem.co/integrations/library-of-integrations/apis) with it:

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FgRXmKZ0nQoGxBoLiSfeZ%2FScreenshot%202024-09-12%20at%2022.15.22.png?alt=media&#x26;token=892816d1-9056-4eb1-a08c-92e2c9012697" alt=""><figcaption></figcaption></figure>

Now you can call it directly from the Ylem pipelines with the necessary query parameters and headers using the [API\_Call](https://docs.ylem.co/pipelines/tasks-ip/api-call) task.

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FMsyeYr42RVvMX1QNmsrJ%2FScreenshot%202024-09-12%20at%2022.15.57.png?alt=media&#x26;token=ba00ce83-ebbe-49c1-b17b-4b5862714352" alt=""><figcaption></figcaption></figure>
