J

Jira Dynamic

Production-ready skill that handles user, mentions, jira, issues. Includes structured workflows, validation checks, and reusable patterns for ai research.

SkillClipticsai researchv1.0.0MIT
0 views0 copies

Jira Integration for Development Workflows

Overview

A comprehensive skill for integrating Jira into development workflows using the Jira API and CLI tools — covering issue management, sprint automation, custom field updates, JQL queries, webhook handling, and CI/CD integration. Enables seamless project tracking alongside code development with automated status updates, smart issue creation, and workflow automation.

When to Use

  • Automating Jira issue management from code/CLI
  • Creating issues programmatically from CI/CD pipelines
  • Building custom dashboards with Jira data
  • Automating sprint planning and tracking
  • Syncing Git commits with Jira issues
  • Building Slack/Teams notifications from Jira events

Quick Start

# Install Jira CLI pip install jira-cli # Configure jira init --server https://your-domain.atlassian.net \ --email [email protected] \ --token YOUR_API_TOKEN # Create an issue jira issue create -t Story -s "Implement user login" -P PROJ # List sprint issues jira sprint list --current # Search with JQL jira issue list --jql "project = PROJ AND sprint in openSprints()"

Python API Usage

from jira import JIRA # Connect jira = JIRA( server="https://your-domain.atlassian.net", basic_auth=("[email protected]", "API_TOKEN"), ) # Create issue new_issue = jira.create_issue( project="PROJ", summary="Implement password reset flow", description="As a user, I want to reset my password via email", issuetype={"name": "Story"}, priority={"name": "High"}, labels=["backend", "auth"], assignee={"accountId": "user-account-id"}, ) print(f"Created: {new_issue.key}") # Search with JQL issues = jira.search_issues( 'project = PROJ AND status = "In Progress" AND assignee = currentUser()', maxResults=50, ) for issue in issues: print(f"{issue.key}: {issue.fields.summary} [{issue.fields.status}]") # Transition issue jira.transition_issue(issue, "Done") # Add comment jira.add_comment(issue, "Completed in PR #123")

JQL Quick Reference

-- Current sprint issues project = PROJ AND sprint in openSprints() -- My open issues assignee = currentUser() AND status != Done -- Bugs created this week project = PROJ AND issuetype = Bug AND created >= startOfWeek() -- High priority unassigned priority in (High, Critical) AND assignee is EMPTY -- Issues with label labels = "tech-debt" AND status != Done -- Issues updated in last 24 hours updated >= -24h AND project = PROJ -- Epic and its children "Epic Link" = PROJ-100 -- Issues without estimate originalEstimate is EMPTY AND issuetype = Story AND sprint in openSprints()

CI/CD Integration

# GitHub Actions — update Jira on PR merge name: Update Jira on: pull_request: types: [closed] jobs: update-jira: if: github.event.pull_request.merged runs-on: ubuntu-latest steps: - name: Extract Jira Key id: jira run: | # Extract PROJ-123 from branch name or PR title KEY=$(echo "${{ github.head_ref }}" | grep -oP '[A-Z]+-\d+' | head -1) echo "key=$KEY" >> $GITHUB_OUTPUT - name: Transition to Done if: steps.jira.outputs.key run: | curl -X POST \ "https://$JIRA_DOMAIN/rest/api/3/issue/${{ steps.jira.outputs.key }}/transitions" \ -H "Authorization: Basic $JIRA_AUTH" \ -H "Content-Type: application/json" \ -d '{"transition": {"id": "31"}}' # 31 = Done transition ID

Webhook Automation

from flask import Flask, request import json app = Flask(__name__) @app.route('/jira-webhook', methods=['POST']) def handle_jira_webhook(): event = request.json event_type = event.get('webhookEvent') issue = event.get('issue', {}) if event_type == 'jira:issue_updated': key = issue['key'] status = issue['fields']['status']['name'] if status == 'In Review': # Notify Slack channel send_slack(f"🔍 {key} is ready for review") elif status == 'Done': # Trigger deployment trigger_deploy(key) return '', 200

Configuration Reference

SettingDescriptionExample
serverJira instance URLhttps://org.atlassian.net
emailUser email for auth[email protected]
tokenAPI tokenGenerate at id.atlassian.net
projectDefault project keyPROJ
board_idScrum/Kanban board ID42
transition_idsWorkflow transition IDs{todo: 11, done: 31}

Best Practices

  1. Use branch naming conventionfeature/PROJ-123-description for automatic linking
  2. Automate status transitions — Move issues to "In Progress" on branch creation, "Done" on merge
  3. Include Jira key in commit messagesPROJ-123: Fix login bug for automatic tracking
  4. Use JQL saved filters — Create reusable queries for common searches
  5. Set up webhooks — Real-time notifications instead of polling
  6. Use bulk operationsjira.search_issues() with JQL instead of individual lookups
  7. Cache API responses — Jira API has rate limits; cache frequently-accessed data
  8. Use API tokens, not passwords — More secure, can be revoked individually
  9. Log issue transitions — Track workflow bottlenecks and cycle time
  10. Integrate with Git hooks — Validate Jira key in commit messages with pre-commit hook

Troubleshooting

API rate limiting

# Add retry with backoff from tenacity import retry, wait_exponential @retry(wait=wait_exponential(multiplier=1, min=2, max=60)) def jira_request(jql): return jira.search_issues(jql)

Transition not allowed

# List available transitions for an issue transitions = jira.transitions(issue) for t in transitions: print(f"ID: {t['id']}, Name: {t['name']}") # Use the correct transition ID

Custom fields not working

# Find custom field IDs for field in jira.fields(): if 'story' in field['name'].lower(): print(f"{field['id']}: {field['name']}") # Use the ID in issue creation jira.create_issue(fields={"customfield_10001": "value"})
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates