Skip to main content

Enhanced Python client for JIRA with better error handling, pagination, and metadata validation.

Project description

PyPI version Python Development Status Maintenance PyPI License


Python JIRA Plus

An enhanced Python client for JIRA that extends the functionality of the official jira package, providing better error handling, pagination, metadata validation, and more.


Features

  • ✅ Simplified connection to JIRA Cloud and On-Premise instances
  • ✅ Robust error handling with automatic retries
  • ✅ Built-in pagination for large result sets
  • ✅ Field validation against JIRA metadata
  • ✅ Enhanced issue creation, retrieval, and updating
  • ✅ Support for allowed values validation

Installation

pip install python-jira-plus

Requirements

  • Python 3.12+
  • jira package
  • retrying package
  • custom-python-logger package

Configuration

The package uses environment variables for authentication and configuration:

# Required environment variables
JIRA_USER_NAME=your_jira_username
JIRA_TOKEN=your_jira_api_token
JIRA_BASE_URL=your-instance.atlassian.net  # Only used if base_url is not provided to constructor

Examples

Creating an Issue with Custom Fields

from python_jira_plus.jira_plus import JiraPlus

jira_client = JiraPlus()
issue = jira_client.create_issue(
    project_key="PROJ",
    summary="Implement new feature",
    description="This feature will improve performance",
    issue_type="Task",
    custom_fields={
        "priority": "Critical",  # Priority
        "customfield_10003": {"name": "Sprint 1"}  # Sprint
    }
)

Searching for Issues

from python_jira_plus.jira_plus import JiraPlus

jira_client = JiraPlus()
issues = jira_client.get_objects_by_query(
    query="project = PROJ AND status = 'In Progress' ORDER BY created DESC",
    max_results=50,
    specific_fields=["summary", "status", "assignee"],
    json_result=False
)

for issue in issues:
    print(f"{issue.key}: {issue.fields.summary} - {issue.fields.status.name}")

Updating an Issue

from python_jira_plus.jira_plus import JiraPlus

jira_client = JiraPlus()
issue = jira_client.get_issue_by_key(key="PROJ-123", json_result=False)

fields_to_update = {
    "summary": "Updated summary",
    "description": "Updated description",
    "customfield_10003": {"name": "Sprint 2"},  # Update Sprint
}
_ = jira_client.update_issue(
    issue_key=issue.key,
    fields_to_update=fields_to_update
)

🤝 Contributing

If you have a helpful tool, pattern, or improvement to suggest: Fork the repo
Create a new branch
Submit a pull request
I welcome additions that promote clean, productive, and maintainable development.


🙏 Thanks

Thanks for exploring this repository!
Happy coding!

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

python_jira_plus-3.0.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

python_jira_plus-3.0.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file python_jira_plus-3.0.0.tar.gz.

File metadata

  • Download URL: python_jira_plus-3.0.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for python_jira_plus-3.0.0.tar.gz
Algorithm Hash digest
SHA256 6c8cad7ae7ea60e10083f9fd5e5df245fe53d098c00b18dcdc617c1d92e61da4
MD5 4e72811c309e324600bfd95f98994823
BLAKE2b-256 1d4628361c3e9fa28edf6e4adee151e6e374f5278d5f98c7614bfe2abab048a1

See more details on using hashes here.

File details

Details for the file python_jira_plus-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_jira_plus-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cf2398df77c850c816f45873b71f471891815eba0e9097b26726e17a3de9540
MD5 ae9db4da576e4bd00bdd1e33cec59bf4
BLAKE2b-256 b2b90b0be19259fb87cc6e8f559c9a8198bd7f9050541610a5fece5d2a68a083

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