# Jira

### Overview

The Jira integration requires the [*Git Integration for Jira*](https://marketplace.atlassian.com/apps/4984/git-integration-for-jira) app, which is found in the Atlassian Marketplace. Using this app, you can configure your Copia repositories to work with Jira to track changes to Git commits and branches.

For this integration, we will first add the app into your Jira account, and then configure the integration by setting up an index.

{% hint style="info" %}
Other Git integration apps are available for Jira in the Atlassian Marketplace, and may work with Copia. We recommend you use the linked app due to its wide usage and ease of setup.
{% endhint %}

### Configure Jira

Our first step will be to add the [*Git Integration for Jira*](https://marketplace.atlassian.com/apps/4984/git-integration-for-jira) app to your account.

To do this, head to Jira, click on the *Settings* drop-down, and select the *Apps* option. Click the *Manage Apps* section on the left side of your screen. Select the *Git Integration for Jira* app and press the *Configure* button.

You should now be on the *Manage Integrations* page. Click on the *Add Integration* button.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FUnWFEyhl7Bem8C18KQiC%2FJira_AddIntegration.png?alt=media\&token=631eba23-5282-492b-af45-feee90ef1a58)

You will be prompted to select the integration type. Choose the *Single Git Repository Integration (Plain Git)* option to continue.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FxvQYkLCvNKtoxcbGuvRI%2FJira_SingleGitRepository.png?alt=media\&token=65a8c737-0d16-4c91-8ceb-2acee8eace8e)

Navigate to the repository you want to configure the integration for. Click the *Create Clone* dropdown and copy the repository URL to your clipboard by clicking the *Copy* button.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FhVhcBnaLexiBcaJtrsy3%2FWebApp_JiraCopyURL.png?alt=media\&token=82699de8-199e-483a-8b17-7df3cfc38843)

Paste the URL you just copied into the *Host URL* field in Jira. You'll also need to fill out the Login and Password fields with your Copia credentials. This will grant Jira access to the repository. Click on the *Add Integration* button to continue.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2Fc1FfYtCXfC946DFEYDPV%2FJira_HostURL.png?alt=media\&token=a7acde51-7c63-48db-ad10-96ef64a1398a)

Click the *Settings* icon on your new integration and choose the *Edit Integration* option.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2F4MgL1Rt7nqHjhGO5LMGy%2FJira_EditIntegration.png?alt=media\&token=be2f6a57-1dd6-40c9-9515-9f1f15685705)

Select the *Feature Settings* option in the left menu, and scroll down to the *Web Linking* section. Configure the fields using the provided snippets.

{% hint style="info" %}
When copying/pasting the below paths, make sure to replace `<repository URL>` with the repository URL you used above for the *Host URL* field.
{% endhint %}

```
Changeset Format:
<repository URL>/commit/${rev}

File Added Format:
<repository URL>/commit/${rev}#diff-${num}

File Modified Format:
<repository URL>/commit/${rev}#diff-${num}

File Deleted Format:
<repository URL>/commit/${rev}#diff-${num}

Branch Format:
<repository URL>/src/branch/${branchname}

Tag Format:
<repository URL>/src/tag/${tagname}
```

Once complete, your settings should look similar to what appears below. Remember to click the *Save* button.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FOp1ysv6VA43fUAMIMNsL%2FJira_WebLinking.png?alt=media\&token=10fef9c9-a56f-4723-bff6-c510d1dd54c5)

Scroll to the top of the screen and select the *Indexing Triggers* option. You can also navigate to this page by going back to *Manage Integrations* and choosing the *Indexing Triggers* option.

Use the toggle to enable *Indexing Triggers*. Take note of Secret Key and Webhook URL -- you'll need them for the final steps.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2F3zElc8T7ewp2soaSxklC%2FJira_SecretKey.png?alt=media\&token=54827ea5-7575-401c-8b12-a4a16df4bd91)

### Create a Webhook in Copia

In Copia, navigate to the repository you connected to Jira. Navigate to the *Settings* tab and choose the *Webhooks* section. Click on the *Add Webhook* button and select the *Copia* option.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FPI4o2BVy2lC87h0iiH3N%2FWebApp_Integration_Jira.png?alt=media\&token=e21aa2cd-02e3-425b-855a-52fec936d7f7)

Copy and paste the Secret Key and Webhook URL from Jira into the *Secret* and *Target URL* fields in Copia. Be sure to choose *All Events* for the trigger option. Click the *Add Webhook* button to complete the integration.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2Fz6LSClqlviSvVcYTLBOw%2FWebApp_Integration_Jira_InProgress.png?alt=media\&token=ff2a1a76-f94c-4c29-b6cd-7bf267bb312a)
