Skip to main content

Automate Jira ticket to GitHub PR workflow

Project description

Ticket2PR

Ticket2PR is an AI-powered automation tool designed to streamline the process of converting development tickets into ready-to-merge pull requests.

Workflow

The tool runs a single pipeline from Jira ticket to GitHub PR. Only the steps that truly need AI use it—everything else is done with APIs and deterministic logic. That keeps token usage and run time low.

Full pipeline:

  1. Workspace — If no workspace path is set (CLI or config), clone the repo to a temp folder; otherwise use the given path. The temp folder is removed when the run finishes.
  2. Fetch Jira issue — Get ticket details via Jira API.
  3. Create branch — Generate branch name from issue key/summary, create it on GitHub, and link the branch to the Jira ticket.
  4. Checkout branch — Git fetch and checkout.
  5. Solve ticket2 AI agents in sequence: a Planner explores the codebase and writes a PLAN.md (no other files); an Executor implements that plan (code edits, then stages the changed files).
  6. Fix tests (optional, --fix-tests)2 AI agents in sequence: a Test planner analyzes staged changes, finds existing related tests, and writes a TESTS_PLAN.md; a Test fixer runs those tests, fixes failures, and stages only the fix-related changes.
  7. Pre-commit (if installed and config present) — Run pre-commit; only if it fails, an AI agent tries to fix lint/format issues (with retries). This step is skipped if pre-commit isn’t installed or if .pre-commit-config.yaml is missing or not a file.
  8. Commit message & PR bodyAI agent: generates a conventional commit message and PR description from the changes and ticket context.
  9. Commit and push — Git commit and push.
  10. PR title — Build title from issue key and summary, e.g. [PROJ-123] Summary.
  11. Create PR — Open the pull request via GitHub API.

Agents

Ticket2PR uses several specialized agents, each with a single responsibility:

Agent Purpose
Planner Reads the Jira ticket, explores the codebase, and writes a single PLAN.md with implementation steps and file list. Does not modify any other files.
Executor Implements the plan: makes the code changes and stages only the files listed in the plan.
Test planner Analyzes staged changes, finds existing related tests, and writes a TESTS_PLAN.md with test paths and run commands (used only with --fix-tests).
Test fixer Runs tests from the plan, diagnoses failures, and applies fixes until all tests pass (used only with --fix-tests).
Pre-commit fixer When pre-commit fails (lint/format, etc.), suggests and applies fixes so hooks pass.
Commit & PR generator Writes a conventional commit message and the PR body from the diff and ticket context.

They run in sequence where needed; the workflow invokes only the agents required for the current run (e.g. no test fixer without --fix-tests, no pre-commit fixer if hooks pass or pre-commit isn’t available).

Getting Started

Follow these steps to set up and start using Ticket2PR:

Installation

You can install ticket2pr directly from PyPI:

pip install ticket2pr

Usage

Run the Ticket2PR CLI to create a pull request from a Jira ticket:

ticket2pr run <JIRA_ISSUE_KEY>

Replace <JIRA_ISSUE_KEY> with the actual ID of your Jira ticket (e.g., PROJ-123).

Use --fix-tests (or -t) to run an extra step after solving the ticket: the tool will plan and run tests from the staged changes, fix any failures with an AI agent, and stage only the fix-related changes before committing.

Configuration

Ticket2PR automatically guides you through the initial configuration process the first time you run the CLI.

To re-initialize the interactive configuration session, run:

ticket2pr init

Alternatively, you can manually configure settings by editing the ~/.ticket2pr/config.toml file or by setting environment variables.

Prerequisites

  • Jira Account and API Token: An account with access to a Jira instance and a valid API token with necessary permissions to view tickets.
  • GitHub Account and Personal Access Token: A GitHub account with permissions to create branches and pull requests in your target repository, and a Personal Access Token (PAT) with repo scope for GitHub API access.
  • Claude Code: Be logged in locally to Claude Code (used for the AI-powered steps).

License

This project is open-sourced under the terms of the LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ticket2pr-0.3.8.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ticket2pr-0.3.8-py2.py3-none-any.whl (39.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ticket2pr-0.3.8.tar.gz.

File metadata

  • Download URL: ticket2pr-0.3.8.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for ticket2pr-0.3.8.tar.gz
Algorithm Hash digest
SHA256 f70dd2f7cc72cb6ea97f3d796bf1eaadc690d592a960b95bf179a5ece09e5571
MD5 f208a4e58b0dff4f41f52519796e5185
BLAKE2b-256 a73c712058dfbb5ed30182659abd94223e226e7565908ddcc652ea9d739d117e

See more details on using hashes here.

File details

Details for the file ticket2pr-0.3.8-py2.py3-none-any.whl.

File metadata

  • Download URL: ticket2pr-0.3.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 39.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for ticket2pr-0.3.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4913780e95cb5200389b881fd0244372a038a935f393d673a1a62a144649c487
MD5 ba33aa8c015b5b94a341796288f1ac7a
BLAKE2b-256 fcd6291c5ed2e4e291fce7980b2ca66c9d96d94eeeb3a7c128bdd5ee9629a6a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page