Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

fetch-jira-issue

БесплатноЗапускает вложенные скриптыНе проверен

Fetch JIRA issue details including status, assignee, comments, and progress classification

openshift-engот openshift-eng★ 123 звезды на GitHub

Об этом скилле

Fetch JIRA Issue

This skill fetches detailed information about a JIRA issue from the Red Hat JIRA REST API. It retrieves status, assignee, priority, resolution, comments, linked PRs, and classifies the issue's progress as ACTIVE, STALLED, or NEEDS_ATTENTION.

When to Use This Skill

Use this skill when you need to:

  • Check the status and progress of a JIRA bug linked to a regression triage
  • Determine if a bug is being actively worked on or needs attention
  • Extract PR links from JIRA comments
  • Get assignee and component information for a JIRA issue
  • Analyze recent comment activity on a bug

Prerequisites

  1. JIRA credentials: Required for authentication, one of:

    • API token:
    • Service account (OAuth client credentials): set JIRA_CLIENT_ID, JIRA_CLIENT_SECRET and JIRA_CLOUD_ID. Used whenever the client ID or secret is set and neither --token nor --username is passed; there is no fallback to the API token. Requests then go to api.atlassian.com instead of redhat.atlassian.net
  2. Network Access: Must be able to reach redhat.atlassian.net

    • Check: curl -s -o /dev/null -w '%{http_code}' https://redhat.atlassian.net
  3. Python 3: Python 3.6 or later

    • Check: python3 --version
    • Uses only standard library (no external dependencies)

Implementation Steps

Step 1: Run the Python Script

# Path to the Python script
script_path="plugins/ci/skills/fetch-jira-issue/fetch_jira_issue.py"

# Fetch issue data in JSON format (default)
python3 "$script_path" OCPBUGS-74401 --format json

# Or fetch as human-readable summary
python3 "$script_path" OCPBUGS-74401 --format summary

# Pass token explicitly instead of using JIRA_API_TOKEN env var
python3 "$script_path" OCPBUGS-74401 --token "your-token" --format json

Step 2: Parse the Output

The script outputs structured JSON data that can be further processed:

# Store result in variable
jira_data=$(python3 "$script_path" OCPBUGS-74401 --format json)

# Extract key fields
status=$(echo "$jira_data" | jq -r '.status')
assignee=$(echo "$jira_data" | jq -r '.assignee.display_name // "Unassigned"')
progress_level=$(echo "$jira_data" | jq -r '.progress.level')
progress_reason=$(echo "$jira_data" | jq -r '.progress.reason')

# Check progress classification
echo "Status: $status"
echo "Assignee: $assignee"
echo "Progress: $progress_level - $progress_reason"

Step 3: Use Progress Classification

The skill automatically classifies issue progress:

  • ACTIVE: Issue is being worked on (assigned with recent activity, PRs linked, or active status)
  • STALLED: Issue is assigned but has no activity in 14+ days
  • NEEDS_ATTENTION: Issue is NEW/unassigned or has no progress
  • RESOLVED: Issue is closed/verified
# Example: Check if a triaged regression's bug needs attention
progress_level=$(echo "$jira_data" | jq -r '.progress.level')

case "$progress_level" in
  "ACTIVE")
    echo "Bug is being worked on - no action needed"
    ;;
  "STALLED")
    echo "Bug may need attention - consider commenting or reassigning"
    ;;
  "NEEDS_ATTENTION")
    echo "Bug needs someone to pick it up"
    ;;
  "RESOLVED")
    echo "Bug is closed"
    ;;
esac

Error Handling

The script exits with code 1 and prints errors to stderr for these cases:

  • No credentials: neither the API token variables (or --token) nor the service-account variables are set, or the service-account set is incomplete
  • Auth failure (401): Token is invalid or expired, or the service-account credential was rejected
  • Access denied (403): Token lacks permissions for the project
  • Not found (404): Issue key doesn't exist
  • Network error: Cannot reach redhat.atlassian.net
# Example: Handle missing token gracefully
if [ -z "$JIRA_CLIENT_ID" ] && { [ -z "$JIRA_API_TOKEN" ] || [ -z "$JIRA_USERNAME" ]; }; then
  echo "Warning: JIRA credentials not set. Skipping JIRA analysis."
else
  jira_data=$(python3 "$script_path" "$jira_key" --format json 2>/dev/null)
  if [ $? -ne 0 ]; then
    echo "Warning: Failed to fetch JIRA issue. Continuing without JIRA data."
  fi
fi

Output Format

JSON Format (--format json)

{
  "key": "OCPBUGS-74401",
  "url": "https://redhat.atlassian.net/browse/OCPBUGS-74401",
  "summary": "ovn-ipsec-host creates duplicate openssl attribute",
  "status": "Modified",
  "resolution": null,
  "priority": "Critical",
  "assignee": {
    "display_name": "Jane Developer",
    "email": "[email protected]"
  },
  "reporter": {
    "display_name": "John Reporter",
    "email": "[email protected]"
  },
  "components": ["Networking / cluster
Полный SKILL.md на GitHub

Установить fetch-jira-issue в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

README.mdfetch_jira_issue.py

FAQ

Что делает скилл fetch-jira-issue?

Fetch JIRA issue details including status, assignee, comments, and progress classification

Как установить скилл fetch-jira-issue?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл fetch-jira-issue запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить fetch-jira-issue с