Skip to main content

Comprehensive Jira API client and CLI tool

Project description

Jira Tool

A comprehensive Jira API client and CLI tool for interacting with Jira Cloud instances. Useful to automate workflows, create rich ADF content, and analyze workflow state durations. Use it in your agents / prompts / instructions for AI agents, or build automation scripts.

Table of Contents

Features

Built for AI agents and automation workflows:

  • Agent-First Design - Enable AI agents to retrieve tickets, parse requirements, and create implementation plans
  • Jira API Client - Python and CLI interface to Jira Cloud REST API v3
  • Structured Data Export - Export issues in JSON, JSONL, CSV formats optimized for agent processing
  • Document Builder - Programmatically create ADF-formatted issues and epics with proper structure
  • Workflow Analysis - Analyze state durations and bottlenecks for retrospectives
  • Epic & Sprint Management - Retrieve epics with children, filter by sprint, group by assignee/status
  • JQL Support - Advanced filtering for complex queries and batch operations
  • Claude Code Integration - Skills, slash commands, and prompts for AI-assisted workflows

Quick Start

Installation

Option 1: System-wide installation (recommended)

Install globally so jira-tool is available anywhere:

# Clone the repository
git clone <repository-url>
cd jira-tool

# Build and install
./scripts/build_and_install.sh

# Verify installation
jira-tool --help

Option 2: Development installation

For development or testing:

# Install with uv (recommended)
uv sync

# Run commands
uv run jira-tool --help

See scripts/README.md for more installation options.

Configuration

Run the interactive setup wizard:

jira-tool setup

This will guide you through:

  1. Entering your Jira URL
  2. Your email address
  3. API token (get one at https://id.atlassian.com/manage-profile/security/api-tokens)
  4. Optional default project

Configuration is saved to ~/.config/jira-tool/config.yaml.

Alternative: Set environment variables in your shell profile:

export JIRA_BASE_URL="https://your-company.atlassian.net"
export JIRA_USERNAME="your-email@example.com"
export JIRA_API_TOKEN="your-api-token"

See Getting Started for detailed setup instructions.

First Commands

# Get issue details
jira-tool get PROJ-123

# Search for issues
jira-tool search "project = PROJ AND status = Open"

# Create a task
jira-tool create --project PROJ --type Task --summary "Fix login bug"

# Export to CSV
jira-tool export --project PROJ --format csv -o tickets.csv

# View your active work
jira-tool export --assignee "me" --status "In Progress"

CLI Commands

Command Description
setup Interactive setup wizard
config View and manage configuration
get Get details of a Jira issue
search Search for issues using JQL
create Create a new issue with ADF formatting
update Update issue fields or transition status
comment Add a comment to an issue
transitions Show available status transitions
epics List all epics in a project
epic-details Get epic details with child issues
export Export issues with filtering (JSON, CSV, JSONL)
analyze Analyze workflow state durations

Examples:

jira-tool get PROJ-123                          # Get issue details
jira-tool search "status = 'In Progress'"       # Search with JQL
jira-tool create --project PROJ --type Epic --summary "New feature"
jira-tool update PROJ-123 --status "Done"       # Transition status
jira-tool export --assignee "me" --format csv   # Export your tickets
jira-tool analyze state-durations issues.json   # Workflow analysis

See: CLI Reference for all commands and Usage Guide for workflows.

Claude Code Integration

This project includes full Claude Code support with slash commands, skills, and prompts for AI-assisted Jira workflows.

Slash Commands

Available in .claude/commands/ - use with /command-name in Claude Code:

Command Description
/get PROJ-123 Get ticket details
/search "JQL query" Search with JQL
/create --project PROJ ... Create an issue
/update PROJ-123 --status "Done" Update an issue
/comment PROJ-123 "message" Add a comment
/export --project PROJ ... Export issues
/epics --project PROJ List epics
/epic-details PROJ-123 Epic with children
/transitions PROJ-123 Show transitions

Skills

Available in .claude/skills/ - reference guides for Claude:

Skill Description
jira-api Jira REST API v3 documentation, endpoints, JQL patterns
jira-builders CLI usage guide and best practices
build-jira-document-format ADF builder patterns with EpicBuilder/IssueBuilder
work-with-adf Atlassian Document Format creation and validation

Prompts

GitHub Copilot-style prompts in .github/prompts/ for complex workflows:

Prompt Description
jira-ticket-retriever Fetch and archive tickets to artifact directories
jira-task-parser Transform tickets into implementation plans
jira-orchestration-lead Coordinate retrieval, parsing, and planning

Workflow Guide: See .github/instructions/jira-workflow-guide.instructions.md for when to use each prompt.

Python API

The Python API provides JiraClient for all Jira operations, document builders (IssueBuilder, EpicBuilder, JiraDocumentBuilder) for creating ADF-formatted content, and StateDurationAnalyzer for workflow analysis.

Quick example:

from jira_tool import JiraClient, IssueBuilder

# Get issues and create structured content
client = JiraClient()
issue = client.get_issue("PROJ-123")

builder = IssueBuilder(title="New feature", story_points=8)
builder.add_description("Feature description")
builder.add_acceptance_criteria(["Criteria 1", "Criteria 2"])

client.create_issue({
    "project": {"key": "PROJ"},
    "summary": "New feature",
    "issuetype": {"name": "Task"},
    "description": builder.build()
})

See: Python API Guide for complete API documentation.

Documentation

Guides

Reference

Examples

Development

Setup Development Environment

# Install dependencies
uv sync

# Run tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=jira_tool

# Format code
uv run black src/ tests/

# Lint code
uv run ruff src/ tests/

# Type check
uv run mypy src/

Project Structure

jira-tool/
├── src/jira_tool/           # Main package
│   ├── client.py            # JiraClient API
│   ├── formatter.py         # Document builders
│   ├── cli.py               # CLI commands
│   └── analysis/            # State analysis
├── .claude/                 # Claude Code integration
│   ├── commands/            # Slash commands (/get, /search, etc.)
│   └── skills/              # Reference skills (jira-api, etc.)
├── .github/                 # GitHub integration
│   ├── prompts/             # AI prompts for workflows
│   └── instructions/        # Workflow guides
├── docs/                    # Documentation
│   ├── guides/              # User guides
│   └── reference/           # API reference
├── examples/                # Example scripts
├── tests/                   # Test suite
└── scripts/                 # Build and install scripts

Code Quality

The project enforces:

  • Black for code formatting
  • Ruff for linting
  • MyPy for type checking (strict mode)
  • Pytest for testing
# Format, lint, and test
uv run black src/ tests/
uv run ruff src/ tests/
uv run pytest

Requirements

  • Python 3.11+
  • Jira Cloud (REST API v3)
  • Valid Jira API token

License

This project is distributed as-is without a specific license.

Support

For issues and questions:


Quick Links:

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

temet_jira-0.1.0a2.tar.gz (296.5 kB view details)

Uploaded Source

Built Distribution

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

temet_jira-0.1.0a2-py3-none-any.whl (69.9 kB view details)

Uploaded Python 3

File details

Details for the file temet_jira-0.1.0a2.tar.gz.

File metadata

  • Download URL: temet_jira-0.1.0a2.tar.gz
  • Upload date:
  • Size: 296.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for temet_jira-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 0bc9f6d80843c5f32928939d4c96437353f530e152523fe15620974456ae255a
MD5 dbbbfb105e15ea2a0fabbeb52b804d88
BLAKE2b-256 1152b0c199398a731f85c101ba067247f8e1a34ffbae5f40ab464436ee69ccaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for temet_jira-0.1.0a2.tar.gz:

Publisher: publish.yml on temet-ai/temet-jira

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file temet_jira-0.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: temet_jira-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 69.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for temet_jira-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 716a94e987028959600e59a752b16ec6d01a7b7e964cd6222c0ed65baebd4430
MD5 689e162b69dd64995db43a4cadd1da6c
BLAKE2b-256 0ad04cecf76939056a3ad8b1d9ae50dd4029cf4d46d9dedc59b43156eb11b804

See more details on using hashes here.

Provenance

The following attestation bundles were made for temet_jira-0.1.0a2-py3-none-any.whl:

Publisher: publish.yml on temet-ai/temet-jira

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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