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

# PR to ticket

<Warning>
  **Git Integration (formerly Qodo Merge)** – AI code review agents for pull requests. This documentation describes the Qodo v1 experience. For the Qodo v2 documentation, click [here.](/code-review)
</Warning>

<Note>
  **Supported Ticket providers:** Jira, Linear, GitHub Issues, GitLab Issues
</Note>

The `create_ticket` tool automatically generates tickets in your ticket tracking system (Jira, Linear, GitHub Issues, or GitLab Issues) based on PR content.

It analyzes the PR's data, including code changes, commit messages, and the PR description, to create well-structured tickets that capture the essence of the development work. This helps teams maintain traceability between code changes and project management systems.

When a ticket is created, it is added to the PR description under an **Auto-created Ticket** section, complete with a link to the generated ticket.

<Frame>
  <img src="https://mintcdn.com/qodo/uIkZ6kAWHm6WXqrW/images/v1/image-185.png?fit=max&auto=format&n=uIkZ6kAWHm6WXqrW&q=85&s=e8f2a02477dfe4e3219cdec72c3d0031" alt="" width="836" height="778" data-path="images/v1/image-185.png" />
</Frame>

## How to use the create\_ticket tool

### Prerequisites

To use this tool, you must integrate your ticketing system with Qodo. [See the Ticket Compliance Documentation for setup instructions.](/v1/integrations/ticketing-integrations)

* **Jira Cloud users:** re-integrate your connection through the Qodo integration page to enable the update permission required for ticket creation.
* Configure the project key for the repository where the PR is created by adding `default_project_key` to your configuration:

```toml theme={null}
[pr_to_ticket]
default_project_key = "PROJECT_KEY" # e.g., "SCRUM"
```

### Automatic ticket creation

The tool can automatically create tickets when:

* A PR is opened or updated
* The PR does not already have an associated ticket

To enable automatic ticket creation, add the following to your `.pr_agent.toml` configuration:

```toml theme={null}
[pr_description]
auto_create_ticket = true
```

This ensures that every code change is documented in the ticketing system without manual intervention.

### Interactive ticket creation via compliance tool

<Note>
  **Supported only on GitHub and GitLab**
</Note>

The tool can be triggered interactively via a checkbox in the Compliance Tool during the PR Compliance Review workflow:

<Steps>
  <Step>
    Check the **Create ticket** box in the Compliance Tool.
  </Step>

  <Step>
    The tool will create the ticket and update the PR Description with an **Auto-created Ticket** section containing the link.
  </Step>

  <Step>
    Click **Update** in the **Ticket Compliance** section to finalize.

    <Frame>
      <img src="https://mintcdn.com/qodo/uIkZ6kAWHm6WXqrW/images/v1/image-186.png?fit=max&auto=format&n=uIkZ6kAWHm6WXqrW&q=85&s=9df8c8d245e9bb4ffb92753559e2c7c8" alt="" width="770" height="688" data-path="images/v1/image-186.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/qodo/uIkZ6kAWHm6WXqrW/images/v1/image-187.png?fit=max&auto=format&n=uIkZ6kAWHm6WXqrW&q=85&s=252bdcfb64ea1405b378915b82ee0c82" alt="" width="1644" height="680" data-path="images/v1/image-187.png" />
    </Frame>
  </Step>
</Steps>

### Manual ticket creation

You can trigger ticket creation manually from any PR by commenting:

```bash theme={null}
/create_ticket
```

Once triggered, the tool will create the ticket and update the PR Description with an **Auto-created Ticket** section containing the link.

### Configuration options

Configure the `create_ticket` tool by setting configurations under the `pr_to_ticket` part in your [configuration file](/v1/configuration/configuration-file/).

| Possible configurations           | Default value | What they do                                                                                                                                                                             |
| :-------------------------------- | :------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `default_project_key`             | (none)        | The default project key for your ticketing system (e.g., `"SCRUM"`). Required unless `fallback_to_git_provider_issues` is `true`.                                                        |
| `default_base_url`                | (none)        | If your organization uses multiple ticketing systems, you can set the default base URL here (e.g., `https://YOUR-ORG.atlassian.net`). Tickets will be created in this system by default. |
| `fallback_to_git_provider_issues` | `false`       | If set to `true`, the tool will create issues in the Git provider's tracker (GitHub/GitLab) when `default_project_key` is not configured.                                                |

### Compliance benefits

The `create_ticket` tool supports SOC-2 compliance by automatically creating tickets from PRs and establishing bidirectional links between them. This ensures every code change is traceable to its corresponding business requirement or task.
