Jira Cloud REST API integration for issue tracking, sprint management, and worklog operations.
Jira Cloud uses API token authentication. Required environment variables:
JIRA_BASE_URL - Your Jira instance (e.g., https://yourcompany.atlassian.net)JIRA_USER_EMAIL - Atlassian account emailJIRA_API_TOKEN - API token from https://id.atlassian.com/manage-profile/security/api-tokensTest connection:
bash
curl -s -u "$JIRA_USER_EMAIL:$JIRA_API_TOKEN" "$JIRA_BASE_URL/rest/api/3/myself" | jq .
All operations use the scripts/jira.py script:
OperationCommandSearch (JQL)jira.py search "project = PROJ AND status = Open"View issuejira.py get PROJ-123Create issuejira.py create PROJ --type Task --summary "Title" --description "Body"Update issuejira.py update PROJ-123 --summary "New title"Add commentjira.py comment PROJ-123 "Comment text"Transitionjira.py transition PROJ-123 "In Progress"List boardsjira.py boardsGet sprintsjira.py sprints BOARD_IDSprint issuesjira.py sprint-issues SPRINT_IDLog workjira.py worklog PROJ-123 --time "2h 30m" --comment "Work done"Get worklogsjira.py worklogs PROJ-123
JQL (Jira Query Language) supports powerful filtering:
bash
# Open issues assigned to me
jira.py search "assignee = currentUser() AND status != Done"
# Issues updated this week
jira.py search "project = PROJ AND updated >= startOfWeek()"
# High priority bugs
jira.py search "type = Bug AND priority in (High, Highest)"
# Issues in current sprint
jira.py search "sprint in openSprints() AND project = PROJ"
Output: JSON array of issues with key, summary, status, assignee, priority.
bash
# Basic task
jira.py create PROJ --type Task --summary "Implement feature X"
# Bug with description and priority
jira.py create PROJ --type Bug \
--summary "Login fails on mobile" \
--description "Steps to reproduce: 1. Open app 2. Enter credentials" \
--priority High
# Story with labels and components
jira.py create PROJ --type Story \
--summary "User profile page" \
--labels "frontend,ui" \
--components "Web App"
bash
# Update summary
jira.py update PROJ-123 --summary "Updated title"
# Update multiple fields
jira.py update PROJ-123 \
--description "New description" \
--priority Medium \
--labels "backend,api"
# Assign to user
jira.py update PROJ-123 --assignee "user@company.com"
Transitions depend on workflow configuration. Get available transitions first:
bash
# List available transitions
jira.py transitions PROJ-123
# Move to status
jira.py transition PROJ-123 "In Progress"
jira.py transition PROJ-123 "Done"
bash
# List all boards
jira.py boards
# Get sprints for a board
jira.py sprints 42
# Get active sprint issues
jira.py sprint-issues 100
# Filter: only active sprints
jira.py sprints 42 --state active
bash
# Log time spent
jira.py worklog PROJ-123 --time "1h 30m" --comment "Code review"
# Log with specific date
jira.py worklog PROJ-123 --time "4h" --started "2024-03-14T09:00:00.000+0000"
# View existing worklogs
jira.py worklogs PROJ-123
See references/fields.md for:
Common errors:
For operations not covered by the script:
bash
# GET request
curl -s -u "$JIRA_USER_EMAIL:$JIRA_API_TOKEN" \
"$JIRA_BASE_URL/rest/api/3/issue/PROJ-123" | jq .
# POST request
curl -s -X POST -u "$JIRA_USER_EMAIL:$JIRA_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"body": {"type": "doc", "version": 1, "content": [{"type": "paragraph", "content": [{"type": "text", "text": "Comment"}]}]}}' \
"$JIRA_BASE_URL/rest/api/3/issue/PROJ-123/comment" | jq .
API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/