Skip to main content

jira2py

PyPI version Python versions License: MIT

A type-safe Python client for the Jira Cloud REST API v3. Use it to read and search issues, create and edit issues, transition workflows, retrieve changelogs, discover canonical field IDs, and work with comments, attachments, links, worklogs, projects, metadata, users, and saved filters.

Scope

jira2py supports Jira Cloud and Python 3.11+. It does not support Jira Server or Data Center, board/sprint/epic workflows, issue deletion or archiving, or a dedicated issue-assignment API.

Install

pip install jira2py

Authenticate safely

Create an Atlassian API token, then provide your Cloud URL, Atlassian account email, and token. Without credentials_file, each credential uses a non-empty explicit url, username, or api_token argument, then its JIRA_URL, JIRA_USER, or JIRA_API_TOKEN environment variable.

When you supply credentials_file, jira2py first loads and validates it as a complete set: the JSON must contain non-empty url, username, and api_token values. A partial file cannot be completed from explicit arguments or environment variables; after validation, non-empty explicit arguments override their matching file values.

There is no default credentials-file path. Keep tokens out of source control, logs, and error reports; use environment variables or a protected local JSON file instead.

export JIRA_URL="https://your-domain.atlassian.net"
export JIRA_USER="your-email@example.com"
export JIRA_API_TOKEN="your-api-token"
{
  "url": "https://your-domain.atlassian.net",
  "username": "your-email@example.com",
  "api_token": "your-api-token"
}

Pass the JSON file only when needed:

from jira2py import JiraAPI

jira = JiraAPI(credentials_file="./jira-credentials.json")

Choose an API layer

  • JiraAPI is the low-level, endpoint-oriented interface. Operations return parsed Jira JSON-like data when available; downloads return bytes and operations without a response body return None.
  • JiraHelpers provides grouped workflows and readable HelperResult values, with optional structured data, for common tasks.
  • format_issue is an optional pure presentation function for an issue response you already retrieved.

Use JiraAPI when you want direct REST payloads and endpoint control. Full issue retrieval is performed only by jira.issues.get_issue():

from jira2py import JiraAPI

jira = JiraAPI()
issue = jira.issues.get_issue("PROJECT-123", fields=["summary", "status"])
results = jira.search.enhanced_search("project = PROJECT AND status = 'In Progress'")

Use format_issue only when you want readable text in addition to that structured response. It does not fetch data or change the response:

from jira2py import JiraAPI
from jira2py.helpers import JiraHelpers, format_issue

api = JiraAPI()
issue = api.issues.get_issue(
    "PROJECT-123",
    fields=["summary", "status", "description"],
)
print(format_issue(issue, browse_url=f"{api.credentials.url}/browse/{issue['key']}"))

helpers = JiraHelpers(api)
print(helpers.metadata.transitions("PROJECT-123").text)
field_page = helpers.metadata.list_fields("PROJECT", field_types=["custom"])
print(field_page.text)  # names plus canonical IDs; one Jira page
print(helpers.attachments.list("PROJECT-123").text)
print(helpers.changelogs.list("PROJECT-123").text)

Structured issue-read migration

Issue reads no longer use a helper or a comma-delimited fields string. Pass one exact selector per sequence item, then optionally format the returned data:

# Before (removed)
from jira2py.helpers import JiraHelpers

helpers = JiraHelpers(api)
api.issues.get_issue("PROJECT-123", fields="summary,status")
helpers.issues.read("PROJECT-123", extra_fields=["customfield_10001"])

# After
issue = api.issues.get_issue(
    "PROJECT-123",
    fields=["summary", "status", "customfield_10001"],
)
text = format_issue(
    issue,
    browse_url=f"{api.credentials.url}/browse/{issue['key']}",
)

The supplied selector sequence is forwarded unchanged: jira2py does not add fields, deduplicate selectors, or request an expansion. None omits fields and lets Jira choose its default unless raw extra_params["fields"] overrides it. Wildcards and negative selectors such as "*all" and "-description" can still return broad responses; choose projections deliberately.

Documentation

License

MIT

Download files

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

Source Distribution

jira2py-0.11.0.tar.gz (77.9 kB view details)

Uploaded Source

Built Distribution

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

jira2py-0.11.0-py3-none-any.whl (64.0 kB view details)

Uploaded Python 3

File details

Details for the file jira2py-0.11.0.tar.gz.

File metadata

  • Download URL: jira2py-0.11.0.tar.gz
  • Upload date:
  • Size: 77.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jira2py-0.11.0.tar.gz
Algorithm Hash digest
SHA256 baf5fc9f28e8784b8c57c998d29cc4534a677a405f5f6334ebfa9f68054d1e88
MD5 ab438c358154c63a57d2dae6f966ade5
BLAKE2b-256 3d2c21d8c797ef7afd8f7d140dcb004b1f42a7c171f4fe2b81d3bebef89568e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for jira2py-0.11.0.tar.gz:

Publisher: publish.yml on en-ver/jira2py

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

File details

Details for the file jira2py-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: jira2py-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 64.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jira2py-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1742481b31b429c0c9118d365c005019ecb725325c079ccfe4008f56a5f16f20
MD5 4e572d5b5e5fe220633bcc0278057c76
BLAKE2b-256 2a2d61ddeea0ae08451301f0831c9515d5c24d8fdddff7fffac920fc2f10e807

See more details on using hashes here.

Provenance

The following attestation bundles were made for jira2py-0.11.0-py3-none-any.whl:

Publisher: publish.yml on en-ver/jira2py

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

Release history Release notifications | RSS feed

This release

0.11.0 This release

2 files

0.10.0

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page