Fetching Ticket Context for PRs¶
Supported Git Platforms: GitHub, GitLab, Bitbucket
Overview¶
Qodo Merge streamlines code review workflows by seamlessly connecting with multiple ticket management systems. This integration enriches the review process by automatically surfacing relevant ticket information and context alongside code changes.
Ticket systems supported:
Ticket data fetched:
- Ticket Title
- Ticket Description
- Custom Fields (Acceptance criteria)
- Subtasks (linked tasks)
- Labels
- Attached Images/Screenshots
Affected Tools¶
Ticket Recognition Requirements:
- The PR description should contain a link to the ticket or if the branch name starts with the ticket id / number.
- For Jira tickets, you should follow the instructions in Jira Integration in order to authenticate with Jira.
Describe tool¶
Qodo Merge will recognize the ticket and use the ticket content (title, description, labels) to provide additional context for the code changes. By understanding the reasoning and intent behind modifications, the LLM can offer more insightful and relevant code analysis.
Review tool¶
Similarly to the describe
tool, the review
tool will use the ticket content to provide additional context for the code changes.
In addition, this feature will evaluate how well a Pull Request (PR) adheres to its original purpose/intent as defined by the associated ticket or issue mentioned in the PR description. Each ticket will be assigned a label (Compliance/Alignment level), Indicates the degree to which the PR fulfills its original purpose:
- Fully Compliant
- Partially Compliant
- Not Compliant
- PR Code Verified
A PR Code Verified
label indicates the PR code meets ticket requirements, but requires additional manual testing beyond the code scope. For example - validating UI display across different environments (Mac, Windows, mobile, etc.).
Configuration options¶
-
By default, the tool will automatically validate if the PR complies with the referenced ticket. If you want to disable this feedback, add the following line to your configuration file:
-
If you set:
(default:false
)the
review
tool will also validate that the PR code doesn't contain any additional content that is not related to the ticket. If it does, the PR will be labeled at best asPR Code Verified
, and thereview
tool will provide a comment with the additional unrelated content found in the PR code.
GitHub Issues Integration¶
Qodo Merge will automatically recognize GitHub issues mentioned in the PR description and fetch the issue content. Examples of valid GitHub issue references:
https://github.com/<ORG_NAME>/<REPO_NAME>/issues/<ISSUE_NUMBER>
#<ISSUE_NUMBER>
<ORG_NAME>/<REPO_NAME>#<ISSUE_NUMBER>
Since Qodo Merge is integrated with GitHub, it doesn't require any additional configuration to fetch GitHub issues.
Jira Integration 💎¶
We support both Jira Cloud and Jira Server/Data Center.
Jira Cloud¶
There are two ways to authenticate with Jira Cloud:
1) Jira App Authentication
The recommended way to authenticate with Jira Cloud is to install the Qodo Merge app in your Jira Cloud instance. This will allow Qodo Merge to access Jira data on your behalf.
Installation steps:
-
Go to the Qodo Merge integrations page
-
Click on the Connect Jira Cloud button to connect the Jira Cloud app
-
After installing the app, you will be redirected to the Qodo Merge registration page. and you will see a success message.
-
Now Qodo Merge will be able to fetch Jira ticket context for your PRs.
2) Email/Token Authentication
You can create an API token from your Atlassian account:
-
Log in to https://id.atlassian.com/manage-profile/security/api-tokens.
-
Click Create API token.
-
From the dialog that appears, enter a name for your new token and click Create.
-
Click Copy to clipboard.
- In your configuration file add the following lines:
Jira Data Center/Server¶
Using Basic Authentication for Jira Data Center/Server¶
You can use your Jira username and password to authenticate with Jira Data Center/Server.
In your Configuration file/Environment variables/Secrets file, add the following lines:
(Note that indeed the 'jira_api_email' field is used for the username, and the 'jira_api_token' field is used for the user password.)
Validating Basic authentication via Python script¶
If you are facing issues retrieving tickets in Qodo Merge with Basic auth, you can validate the flow using a Python script. This following steps will help you check if the basic auth is working correctly, and if you can access the Jira ticket details:
-
run
pip install jira==3.8.0
-
run the following Python script (after replacing the placeholders with your actual values):
Script to validate basic auth
from jira import JIRA
if __name__ == "__main__":
try:
# Jira server URL
server = "https://..."
# Basic auth
username = "..."
password = "..."
# Jira ticket code (e.g. "PROJ-123")
ticket_id = "..."
print("Initializing JiraServerTicketProvider with JIRA server")
# Initialize JIRA client
jira = JIRA(
server=server,
basic_auth=(username, password),
timeout=30
)
if jira:
print(f"JIRA client initialized successfully")
else:
print("Error initializing JIRA client")
# Fetch ticket details
ticket = jira.issue(ticket_id)
print(f"Ticket title: {ticket.fields.summary}")
except Exception as e:
print(f"Error fetching JIRA ticket details: {e}")
Using a Personal Access Token (PAT) for Jira Data Center/Server¶
- Create a Personal Access Token (PAT) in your Jira account
- In your Configuration file/Environment variables/Secrets file, add the following lines:
[jira]
jira_base_url = "YOUR_JIRA_BASE_URL" # e.g. https://jira.example.com
jira_api_token = "YOUR_API_TOKEN"
Validating PAT token via Python script¶
If you are facing issues retrieving tickets in Qodo Merge with PAT token, you can validate the flow using a Python script. This following steps will help you check if the token is working correctly, and if you can access the Jira ticket details:
-
run
pip install jira==3.8.0
-
run the following Python script (after replacing the placeholders with your actual values):
Script to validate PAT token
from jira import JIRA
if __name__ == "__main__":
try:
# Jira server URL
server = "https://..."
# Jira PAT token
token_auth = "..."
# Jira ticket code (e.g. "PROJ-123")
ticket_id = "..."
print("Initializing JiraServerTicketProvider with JIRA server")
# Initialize JIRA client
jira = JIRA(
server=server,
token_auth=token_auth,
timeout=30
)
if jira:
print(f"JIRA client initialized successfully")
else:
print("Error initializing JIRA client")
# Fetch ticket details
ticket = jira.issue(ticket_id)
print(f"Ticket title: {ticket.fields.summary}")
except Exception as e:
print(f"Error fetching JIRA ticket details: {e}")
Multi-JIRA Server Configuration 💎¶
Qodo Merge supports connecting to multiple JIRA servers using different authentication methods.
Configure multiple servers using Email/Token authentication:
jira_servers
: List of JIRA server URLsjira_api_token
: List of API tokens (for Cloud) or passwords (for Data Center)jira_api_email
: List of emails (for Cloud) or usernames (for Data Center)jira_base_url
: Default server for ticket IDs likePROJ-123
, Each repository can configure (local config file) its ownjira_base_url
to choose which server to use by default.
Example Configuration:
[jira]
# Server URLs
jira_servers = ["https://company.atlassian.net", "https://datacenter.jira.com"]
# API tokens/passwords
jira_api_token = ["cloud_api_token_here", "datacenter_password"]
# Emails/usernames (both required)
jira_api_email = ["[email protected]", "datacenter_username"]
# Default server for ticket IDs
jira_base_url = "https://company.atlassian.net"
Configure multiple servers using Personal Access Token authentication:
jira_servers
: List of JIRA server URLsjira_api_token
: List of PAT tokensjira_api_email
: Not needed (can be omitted or left empty)jira_base_url
: Default server for ticket IDs likePROJ-123
, Each repository can configure (local config file) its ownjira_base_url
to choose which server to use by default.
Example Configuration:
[jira]
# Server URLs
jira_servers = ["https://server1.jira.com", "https://server2.jira.com"]
# PAT tokens only
jira_api_token = ["pat_token_1", "pat_token_2"]
# Default server for ticket IDs
jira_base_url = "https://server1.jira.com"
Mixed Authentication (Email/Token + PAT):
[jira]
jira_servers = ["https://company.atlassian.net", "https://server.jira.com"]
jira_api_token = ["cloud_api_token", "server_pat_token"]
jira_api_email = ["[email protected]", ""] # Empty for PAT
For Jira Cloud instances using App Authentication:
- Install the Qodo Merge app on each JIRA Cloud instance you want to connect to
- Set the default server for ticket ID resolution:
Full URLs (e.g., https://other-team.atlassian.net/browse/TASK-456
) will automatically use the correct connected instance.
How to link a PR to a Jira ticket¶
To integrate with Jira, you can link your PR to a ticket using either of these methods:
Method 1: Description Reference:
Include a ticket reference in your PR description, using either the complete URL format https://<JIRA_ORG>.atlassian.net/browse/ISSUE-123
or the shortened ticket ID ISSUE-123
(without prefix or suffix for the shortened ID).
Method 2: Branch Name Detection:
Name your branch with the ticket ID as a prefix (e.g., ISSUE-123-feature-description
or ISSUE-123/feature-description
).
Jira Base URL
For shortened ticket IDs or branch detection (method 2 for JIRA cloud), you must configure the Jira base URL in your configuration file under the [jira] section:
Where<JIRA_ORG>
is your Jira organization identifier (e.g., mycompany
for https://mycompany.atlassian.net
).
Linear Integration 💎¶
Linear App Authentication¶
The recommended way to authenticate with Linear is to connect the Linear app through the Qodo Merge portal.
Installation steps:
-
Go to the Qodo Merge integrations page
-
Navigate to the Integrations tab
-
Click on the Linear button to connect the Linear app
-
Follow the authentication flow to authorize Qodo Merge to access your Linear workspace
-
Once connected, Qodo Merge will be able to fetch Linear ticket context for your PRs
How to link a PR to a Linear ticket¶
Qodo Merge will automatically detect Linear tickets using either of these methods:
Method 1: Description Reference:
Include a ticket reference in your PR description using either:
- The complete Linear ticket URL: https://linear.app/[ORG_ID]/issue/[TICKET_ID]
- The shortened ticket ID: [TICKET_ID]
(e.g., ABC-123
) - requires linear_base_url configuration (see below).
Method 2: Branch Name Detection:
Name your branch with the ticket ID as a prefix (e.g., ABC-123-feature-description
or feature/ABC-123/feature-description
).