# 💎 PR to Ticket - Qodo Merge (and open-source PR-Agent)

Skip to content

# 💎 PR to Ticket

`Platforms supported: GitHub, GitLab, Bitbucket`

`Supported Ticket providers: Jira, Linear, GitHub Issues, Gitlab Issues`

## Overview

The `create_ticket` tool automatically generates tickets in ticket tracking systems (`Jira`, `Linear`, or `GitHub Issues` and `Gitlab issues`) based on PR content.

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

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

Pre-requisites

- To use this tool you need to integrate your ticketing system with Qodo-merge, follow the Ticket Compliance Documentation.
- For Jira Cloud users, please re-integrate your connection through the qodo merge integration page to enable the `update` permission required for ticket creation
- You need to configure the project key in ticket corresponding to the repository where the PR is created. This is done by adding the `default_project_key`.

    [pr_to_ticket]
    default_project_key = "PROJECT_KEY" # e.g., "SCRUM"

## Usage

there are 3 ways to use the `create_ticket` tool:

1. Automatic Ticket Creation
2. Interactive Triggering via Compliance Tool
3. Manual Ticket Creation

### Automatic Ticket Creation

The tool can be configured to automatically create tickets when a PR is opened or updated and the PR does not already have a ticket associated with it. This ensures that every code change is documented in the ticketing system without manual intervention.

To configure automatic ticket creation, add the following to `.pr_agent.toml`:

    [pr_description]
    auto_create_ticket = true

### Interactive Triggering via Compliance Tool

`Supported only in Github and Gitlab`

The tool can be triggered interactively through a checkbox in the compliance tool. This allows users to create tickets as part of their PR Compliance Review workflow.

- After clicking the checkbox, the tool will create a ticket and will add/update the `PR Description` with a section called `Auto-created Ticket` with the link to the created ticket.
- Then you can click `update` in the `Ticket compliance` section in the `Compliance` tool

### Manual Ticket Creation

Users can manually trigger the ticket creation process from the PR interface.

To trigger ticket creation manually, the user can call this tool from the PR comment:

    /create_ticket

After triggering, the tool will create a ticket and will add/update the `PR Description` with a section called `Auto-created Ticket` with the link to the created ticket.

## Configuration

## Configuration Options

Configuration

default_project_key | The default project key for your ticketing system (e.g., `SCRUM`). This is required unless `fallback_to_git_provider_issues` is set to `true`.
default_base_url | If your organization have integrated to multiple ticketing systems, you can set the default base URL for the ticketing system. This will be used to create tickets in the default system. Example: `https://YOUR-ORG.atlassian.net`.
fallback_to_git_provider_issues | If set to `true`, the tool will create issues in the Git provider's issue tracker (GitHub, Gitlab) if the `default_project_key` is not configured in the repository configuration. Default is `false`.

## Helping Your Organization Meet SOC-2 Requirements

The `create_ticket` tool helps your organization satisfy SOC-2 compliance. By automatically creating tickets from PRs and establishing bidirectional links between them, it ensures every code change is traceable to its corresponding business requirement or task.

Footer