# Jira
URL: https://docs.clearly-ai.com/docs/integrations/issue-trackers/jira
Description: Connect Clearly AI to Jira.
Connect Jira so Clearly AI can read issue data and attachments, create or update Jira issues, add comments, and receive Jira events for Workflows and Ticket Sync.

Clearly AI acts as the Jira user whose credentials you configure. For example, if the API token belongs to `alex@example.com`, comments created by Clearly AI appear as Alex.

[Image: Jira comment authored by the credential owner]

## Prerequisites [#prerequisites]

* A Clearly AI account with access to **Integrations** and **Connections**.
* A Jira Cloud site, such as `https://mycompany.atlassian.net`.
* Permission to create a Jira API token.
* A Jira account with access to the projects and issues Clearly AI should use.

For shared or production use, ask your IT team to create a dedicated Jira service account, such as **Clearly AI bot**, and generate the API token from that account. This keeps Clearly AI activity separate from individual employee accounts.

## Make the Jira account email visible [#make-the-jira-account-email-visible]

Jira webhook handling requires the email address for the credential owner to be visible. In Atlassian account settings, open [Profile and visibility](https://id.atlassian.com/manage-profile/profile-and-visibility) and set the account email visibility to **Anyone**.

[Image: Atlassian profile visibility settings]

## Create the Jira API token [#create-the-jira-api-token]

1. Open [Atlassian account security](https://id.atlassian.com/manage-profile/security).
2. Under **API tokens**, click **Create and manage API tokens**.
3. Create an API token with the scopes below.
4. Set an expiry that matches your security policy. Atlassian tokens can expire no later than one year after creation.
5. Copy the token. You will paste it into Clearly AI in the next step.

Use these scopes:

| Scope                            | Purpose                                         |
| -------------------------------- | ----------------------------------------------- |
| `delete:issue:jira`              | Delete issues during cleanup                    |
| `read:application-role:jira`     | Read the authenticated user's application roles |
| `read:attachment:jira`           | Read and download issue attachments             |
| `read:avatar:jira`               | Read user avatars                               |
| `read:comment.property:jira`     | Read comment metadata                           |
| `read:comment:jira`              | Read issue comments                             |
| `read:field-configuration:jira`  | Read field configurations                       |
| `read:field.default-value:jira`  | Read default field values                       |
| `read:field.option:jira`         | Read allowed field values                       |
| `read:field:jira`                | Read Jira field definitions                     |
| `read:group:jira`                | Read the user's Jira groups                     |
| `read:issue-details:jira`        | Read issue details                              |
| `read:issue-meta:jira`           | Read issue field metadata                       |
| `read:issue-security-level:jira` | Read issue security levels                      |
| `read:issue-status:jira`         | Read issue statuses                             |
| `read:issue-type-hierarchy:jira` | Read parent and child issue relationships       |
| `read:issue-type:jira`           | List project issue types                        |
| `read:issue.changelog:jira`      | Read issue change history                       |
| `read:issue.remote-link:jira`    | Read issue remote links                         |
| `read:issue.transition:jira`     | Read available issue transitions                |
| `read:issue.vote:jira`           | Read issue votes                                |
| `read:issue:jira`                | Read and search issues                          |
| `read:priority:jira`             | List Jira priorities                            |
| `read:project-category:jira`     | Read project categories                         |
| `read:project-role:jira`         | Read project roles                              |
| `read:project-version:jira`      | Read project versions                           |
| `read:project.component:jira`    | Read project components                         |
| `read:project.property:jira`     | Read project properties                         |
| `read:project:jira`              | List projects                                   |
| `read:status:jira`               | List project workflow statuses                  |
| `read:user.property:jira`        | Read Jira user details                          |
| `read:user:jira`                 | Read Jira users                                 |
| `write:attachment:jira`          | Upload issue attachments                        |
| `write:comment.property:jira`    | Write comment metadata                          |
| `write:comment:jira`             | Add issue comments                              |
| `write:issue.property:jira`      | Write issue properties                          |
| `write:issue.remote-link:jira`   | Add issue remote links                          |
| `write:issue:jira`               | Create and update issues                        |

Include every scope in this table when you create a granular API token. Jira Forms only accepts the classic `read:jira-work` scope, so a granular token fetches issues without their forms.

[Image: Jira API token scope selection]

[Image: Jira API token created]

## Connect Jira in Clearly AI [#connect-jira-in-clearly-ai]

1. In Clearly AI, open **Organization settings**, select **Integrations**, then click **Allow** on the Jira card. Skip this step if Jira is already under **Allowed**.
2. Open **Connections** and click **Add connection**.
3. In **Integration**, select **Jira**.
4. Under **Who can use it**, select **Everyone in the workspace**.
5. Under **Authentication method**, select **API token**.
6. In **Base URL**, enter your Jira site URL, such as `https://mycompany.atlassian.net`.
7. In **User Email**, enter the email address for the Jira account that owns the API token.
8. In **API token**, paste the API token.
9. Click **Save Authentication**. Clearly AI tests the credential when you save.

If the test fails, check the token's scopes, the email address, and the account's access to the Jira site.

## Create Jira issues from Chat [#create-jira-issues-from-chat]

Chat can create Jira issues through the workspace Jira connector. With the default **Ask** permission on Jira's write tools, Chat requests approval before creating an issue, and the approval preview lists the issue fields, including **Parent epic** when set.

Before creating an issue, Chat asks whether it should go under an epic unless you already specified one or said you want no epic. Give Chat the epic key, such as `SEC-123`, or its title. If you give a title, Chat searches Jira for the key. Say you want no epic to create a top-level issue. Jira decides whether the parent is valid for the issue type.

## Send Jira changes to Clearly AI [#configure-jira-webhooks-for-workflows]

Jira sends changes to Clearly AI through a Jira Automation rule. Workflows use these events as triggers, and Ticket Sync uses them to update risks linked to Jira work items. One rule can send events for both.

### Generate the Clearly AI webhook secret [#generate-the-clearly-ai-webhook-secret]

1. In Clearly AI, open **Organization settings**, select **Integrations**, click **Configure** on the Jira card, and click **Edit webhook** in the **Webhook** section.
2. Click **Generate new secret** next to **Secret**. Copy the secret and store it temporarily.
3. Click **Save and test**.
4. Click **Edit webhook** again and copy the **Webhook URL**.

You will use both the webhook URL and the secret in Jira automation.

### Create a Jira automation rule [#create-a-jira-automation-rule]

In Jira, open **Project settings > Automation > Create rule > Create from scratch**.

Use Jira **Automation**, not Jira **Webhooks**. The example below sends an event to Clearly AI when selected labels are added or changed, which suits a Workflow trigger.

1. Add a trigger:
   * Select **Field value changed**.
   * Set the field to **Labels**.
   * Set the change type to **Any changes to the field value**.
2. Add a condition:
   * Select **Work item fields condition**.
   * Set the field to **Labels**.
   * Set the condition to **contains any of**.
   * Choose the label values that should trigger Clearly AI, such as `clearly-needs-review`.
3. Add an action:
   * Select **Send web request**.
   * Set **Web Request URL** to the Clearly AI **Webhook URL**.
   * Set **HTTP Method** to **POST**.
   * Set **Web Request Body** to **Issue Data (Automation format)**.
   * Add the headers below.
   * Enable **Check to allow other rule actions to trigger this rule** if another automation may add the trigger label.

| Header                     | Value                                                                                 |
| -------------------------- | ------------------------------------------------------------------------------------- |
| `X-Clearly-Webhook-Secret` | The **Webhook Secret** from Clearly AI                                                |
| `X-Clearly-User`           | The Clearly AI user email to use when Jira cannot resolve a valid user from the event |

[Image: Jira automation web request configuration]

<Callout type="warn">
  Mark the `X-Clearly-Webhook-Secret` header value as **Hidden**. Jira loses hidden values when you duplicate the rule, export and import it, or duplicate the **Send web request** step. Re-enter the secret after any of these.

  Generating a new secret in Clearly AI stops every rule that still sends the old one. Update the header in each rule after you generate a new secret.
</Callout>

### Update linked risks with Ticket Sync [#update-linked-risks-with-ticket-sync]

Ticket Sync uses the same webhook URL, secret, and **Send web request** action. When Jira sends an update for a work item linked to a risk, Clearly AI applies these fields to the risk:

| Jira field  | Risk field  | When it applies                                                                                                                         |
| ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Summary     | Title       | Always                                                                                                                                  |
| Description | Description | Always                                                                                                                                  |
| Status      | Status      | When the Jira status appears in the Ticket Sync status mapping. Clearly AI skips an unmapped status and still applies the other fields. |
| Assignee    | Owner       | Only when **Assignee** is set to **Risk Owner, kept in sync**. Clearly AI matches the assignee's email to a Clearly AI user.            |

Priority and due date don't sync back. Clearly AI only sends them to Jira.

1. Create the rule in the Ticket Sync target project: **Project settings > Automation > Create rule > Create from scratch**. A rule that covers several projects also works, because Clearly AI ignores work items that aren't linked to a risk.
2. Add a trigger:
   * Select **Field value changed**.
   * Set the fields to **Summary**, **Description**, **Status**, and **Assignee**.
   * Set the change type to **Any changes to the field value**.
3. Add the **Send web request** action with the same settings and headers as the Workflows rule above.

Use **Field value changed** rather than **Work item updated**. Jira's **Work item updated** trigger doesn't run when a work item changes status.

One rule can serve both Workflows and Ticket Sync. Clearly AI runs matching Workflows and updates the linked risk from the same request. A condition on the rule, such as the label condition above, also limits which changes reach Ticket Sync.

## Validate the webhook [#validate-the-webhook]

Return to the Jira integration in Clearly AI and use **Validate your request configuration**. A correct setup returns `200 OK`. After validation succeeds, Jira events that match your automation rule can trigger Clearly AI Workflows.

[Image: Clearly AI webhook validation result]

## FAQs [#faqs]

<Accordions>
  <Accordion title="Why does Chat say it can't create Jira issues?">
    Open **Connections** and check that the **Chat** switch is on for the Jira connection. Click **Manage** to check the permissions on Jira's write tools under **Chat tools**. Clearly AI refreshes tool lists automatically, so you don't need to sync them manually.
  </Accordion>

  <Accordion title="Why does the connection test fail?">
    Confirm the API token is active, the email matches the token owner, and the token includes the required scopes.
  </Accordion>

  <Accordion title="Why do comments appear under the wrong user?">
    Clearly AI comments as the Jira account that owns the API token. Use a dedicated service account if you need consistent attribution.
  </Accordion>

  <Accordion title="Why does webhook validation fail?">
    Confirm the Jira automation sends **Issue Data (Automation format)**, includes both required headers, and uses the current Clearly AI webhook URL and secret.
  </Accordion>

  <Accordion title="Why doesn’t the workflow run after a Jira update?">
    Confirm the Jira automation rule is enabled, the issue update matches your trigger and condition, and the Workflow is enabled in Clearly AI.
  </Accordion>

  <Accordion title="Why doesn't a Jira change update the linked risk?">
    Confirm the rule is enabled, sends the current webhook secret, and triggers on the field that changed. Status changes apply only for statuses in the Ticket Sync status mapping, and Owner changes apply only when **Assignee** is set to **Risk Owner, kept in sync**.
  </Accordion>
</Accordions>