Skip to main content

Pull SonarQube issues, review them, and create JIRA tickets distributed among teammates

Project description

sonar-jira-sync

PyPI version License: MIT

Pull SonarQube issues, review them in a local web UI, and create JIRA tickets distributed equally among your team.

Features

  • Fetch issues from SonarQube, grouped by severity
  • Equal distribution of tickets among teammates (round-robin within each severity)
  • Local web UI for reviewing issues and approving ticket creation
  • CLI with summary and interactive mode
  • MCP server for AI assistant integration (Cursor, Claude, etc.)

Installation

pip install sonar-jira-sync

For MCP server support:

pip install sonar-jira-sync[mcp]

Note: If you get command not found: sonar-jira-sync after install, your Python scripts directory may not be on PATH. Add it:

# Find where pip installed the script
pip show -f sonar-jira-sync | grep "Location"

# Add to ~/.zshrc (macOS) or ~/.bashrc (Linux) — example for macOS:
echo 'export PATH="/Library/Frameworks/Python.framework/Versions/3.12/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Alternatively, use pipx install sonar-jira-sync which handles PATH automatically.

Quick Start

  1. Copy and customize the config:
cp config.example.yaml config.yaml
  1. Create a .env file with your credentials:
SONAR_TOKEN=your-sonarqube-token
JIRA_EMAIL=your-email@company.com
JIRA_TOKEN="your-jira-api-token"

Note: If your token contains special characters like =, wrap it in double quotes.

  1. Source the .env and run:
set -a && source .env && set +a
sonar-jira-sync run

Or get a CLI summary:

sonar-jira-sync summary

Tip: You must source .env in each new terminal session, or add set -a && source /path/to/.env && set +a to your ~/.zshrc for persistence.

Usage

CLI Commands

Command Description
sonar-jira-sync run Launch web UI for interactive review
sonar-jira-sync summary Show issues and distribution preview
sonar-jira-sync summary -s CRITICAL,MAJOR Filter by severity
sonar-jira-sync mcp Start MCP server

MCP Integration

Add to your Cursor MCP config (~/.cursor/mcp.json):

{
  "sonar-jira-sync": {
    "command": "sonar-jira-sync",
    "args": ["mcp", "-c", "/path/to/config.yaml"],
    "env": {
      "SONAR_TOKEN": "your-sonarqube-token",
      "JIRA_EMAIL": "your-email@company.com",
      "JIRA_TOKEN": "your-jira-api-token"
    }
  }
}

Note: If sonar-jira-sync is not on your PATH, use the full path to the binary:

"command": "/Library/Frameworks/Python.framework/Versions/3.12/bin/sonar-jira-sync"

Find it with: which sonar-jira-sync or pip show -f sonar-jira-sync

Available MCP tools:

  • fetch_issues - Get SonarQube issues grouped by severity
  • preview_distribution - Preview ticket distribution among teammates
  • create_jiras - Create JIRA tickets (requires explicit confirmation)
  • get_config_info - Show current configuration

Configuration

See config.example.yaml for all options. Sensitive values (tokens) are loaded from environment variables:

Variable Purpose
SONAR_TOKEN SonarQube authentication token
JIRA_EMAIL JIRA account email
JIRA_TOKEN JIRA API token

Publishing to PyPI

Build and upload:

pip install build twine
python -m build
twine upload dist/*

Contributing

  1. Clone the repo:
git clone https://github.com/arpanroy41/sonar-jira-sync.git
cd sonar-jira-sync
  1. Install in development mode:
pip install -e ".[dev]"
  1. Run tests:
pytest

License

MIT

Author

arpanroy41

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

sonar_jira_sync-0.1.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

sonar_jira_sync-0.1.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file sonar_jira_sync-0.1.0.tar.gz.

File metadata

  • Download URL: sonar_jira_sync-0.1.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sonar_jira_sync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 de0d393e84c8978b9690478b243c057596c43f3d0cb0db9a3c3306918e6db77e
MD5 72d72f0fc07dd54801785b5f0f2ea79c
BLAKE2b-256 5678cfbda2208db5aa67bb7d73f52e0c050c172a953cf12fd9e0fc36c38ea13a

See more details on using hashes here.

File details

Details for the file sonar_jira_sync-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sonar_jira_sync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a828c9a2a548f475369a36388f0c7c9320bba76307150124036e349b85e60d2c
MD5 ebe62fb51328d4d972c15eb450cbb4e3
BLAKE2b-256 192e3c5e1649b3fd006b4927d02a1a7761813d5b22da84c0c02fb3a97b6fc3fa

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