Jira API (Python)
Two separate community-maintained Python libraries exist for Jira: 'jira' (pip install jira, v3.10.5) and 'atlassian-python-api' (pip install atlassian-python-api, v4.0.7). Neither is an official Atlassian SDK. They have different APIs, auth patterns, and JQL methods. Agents frequently mix them up.
Warnings
- breaking Two competing packages: 'jira' (imports as JIRA) and 'atlassian-python-api' (imports as Jira). Tutorials and LLM-generated code mix them constantly. They are not interchangeable.
- breaking Jira Cloud blocks password auth. API token must be passed as the password field, not an actual password. Regular account passwords return 401.
- breaking atlassian-python-api: cloud=True is required for Jira Cloud. Omitting it causes requests to fail against Cloud endpoints silently or with confusing 404s.
- breaking atlassian-python-api: jql() method is deprecated for Jira Cloud. Use enhanced_jql() instead.
- gotcha Jira Server/Data Center uses Personal Access Token (PAT) via token= parameter. Jira Cloud uses API token via username+password. The auth pattern differs by deployment type.
- gotcha jira package: search_issues() returns max 50 results by default. Silent truncation — no error raised if results exceed limit.
- gotcha Neither package is an official Atlassian product. Atlassian has no official Python SDK. Both are community-maintained.
Install
-
pip install jira -
pip install atlassian-python-api
Imports
- JIRA
from jira import JIRA
- Jira
from atlassian import Jira
Quickstart
# --- Option A: jira package (pycontribs) ---
from jira import JIRA
jira = JIRA(
server='https://your-domain.atlassian.net',
basic_auth=('your-email@example.com', 'your-api-token')
)
issue = jira.issue('PROJ-1')
print(issue.fields.summary)
# --- Option B: atlassian-python-api ---
from atlassian import Jira
jira = Jira(
url='https://your-domain.atlassian.net',
username='your-email@example.com',
password='your-api-token',
cloud=True # required for Cloud
)
data = jira.enhanced_jql('project = PROJ ORDER BY created DESC')
print(data)