$npx -y skills add opendatahub-io/ai-helpers --skill jira-workitem-viewRetrieve and display full details of a Jira ticket. Fetches all fields and formats them for conversation context. Use when user needs ticket information or wants to examine a ticket.
| 1 | # Jira Workitem View |
| 2 | |
| 3 | Retrieve and display comprehensive details of a Jira ticket using the `acli` CLI. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | - `acli` must be installed and authenticated (`acli jira auth`) |
| 8 | |
| 9 | ## Implementation |
| 10 | |
| 11 | ### Step 1: Verify ACLi Setup |
| 12 | |
| 13 | Before proceeding, verify that acli is installed and authenticated by invoking the `acli-setup-check` skill: |
| 14 | |
| 15 | ```text |
| 16 | /acli-setup-check |
| 17 | ``` |
| 18 | |
| 19 | If the setup check fails, stop execution and guide the user to fix the issue. |
| 20 | |
| 21 | ### Step 2: Determine Ticket Key |
| 22 | |
| 23 | 1. If a ticket key is provided by the user (e.g., "AIPCC-1234"), use it |
| 24 | 2. Otherwise, search the conversation history for Jira ticket references matching the pattern `[A-Z]+-\d+` |
| 25 | 3. If no ticket is found, ask the user: "Which Jira ticket would you like to view?" |
| 26 | |
| 27 | ### Step 3: Fetch Full Ticket Details |
| 28 | |
| 29 | Execute the command to retrieve all ticket fields: |
| 30 | |
| 31 | # Fetch ticket details with validated key |
| 32 | acli jira workitem view "$TICKET_KEY" --fields '*all' --json |
| 33 | ``` |
| 34 | |
| 35 | This returns a comprehensive JSON object containing all ticket fields, custom fields, and metadata. |
| 36 | |
| 37 | ### Step 4: Parse and Format Output |
| 38 | |
| 39 | Parse the JSON output and extract the following fields for display: |
| 40 | |
| 41 | #### Core Fields |
| 42 | - **Key**: Issue key (e.g., AIPCC-1234) |
| 43 | - **Summary**: Issue title |
| 44 | - **Type**: Issue type (Bug, Story, Epic, Feature, etc.) |
| 45 | - **Status**: Current status (To Do, In Progress, Done, etc.) |
| 46 | - **Priority**: Priority level |
| 47 | - **Project**: Project key and name |
| 48 | |
| 49 | #### People |
| 50 | - **Assignee**: Current assignee (or "Unassigned") |
| 51 | - **Reporter**: Person who created the ticket |
| 52 | - **Creator**: Original creator (if different from reporter) |
| 53 | |
| 54 | #### Dates |
| 55 | - **Created**: Creation timestamp |
| 56 | - **Updated**: Last update timestamp |
| 57 | - **Due Date**: Due date (if set) |
| 58 | - **Resolution Date**: When the ticket was resolved (if resolved) |
| 59 | |
| 60 | #### Content |
| 61 | - **Description**: Convert from Atlassian Document Format (ADF) to plain text if needed. Display the first 500 characters with option to show full text. |
| 62 | - **Labels**: List of labels |
| 63 | - **Components**: List of components |
| 64 | - **Fix Version**: Target version (if set) |
| 65 | |
| 66 | #### AIPCC Custom Fields (if applicable) |
| 67 | - **Status Summary** (customfield_10814): Leadership status update |
| 68 | - **Color Status** (customfield_10712): Red/Yellow/Green health indicator |
| 69 | |
| 70 | #### Relationships |
| 71 | - **Parent**: Parent epic or feature (if set) |
| 72 | - **Child Issues**: Count and list of child issues |
| 73 | - **Links**: Related tickets (blocks, is blocked by, relates to, etc.) |
| 74 | - **Subtasks**: List of subtasks |
| 75 | |
| 76 | #### Recent Activity |
| 77 | - **Last 3-5 Comments**: Show the most recent comments with author and timestamp |
| 78 | |
| 79 | ### Step 5: Display Results |
| 80 | |
| 81 | Present the parsed information in a structured, human-readable format: |
| 82 | |
| 83 | ``` |
| 84 | === AIPCC-1234: Fix duplicate CI pipeline runs === |
| 85 | |
| 86 | Type: Bug |
| 87 | Status: In Progress → Done |
| 88 | Priority: Medium |
| 89 | Assignee: code-samurai |
| 90 | Reporter: super-picky-reviewer |
| 91 | |
| 92 | Created: 2024-03-15 |
| 93 | Updated: 2024-03-20 |
| 94 | Due Date: 2024-03-25 |
| 95 | |
| 96 | Components: Wheel Package Index |
| 97 | Labels: ci, automation, bug-fix |
| 98 | |
| 99 | Description: |
| 100 | [First 500 chars of description...] |
| 101 | (use --full to show complete description) |
| 102 | |
| 103 | Status Summary (2024-03-20): |
| 104 | Work progressing normally. CI fix merged and tested in staging. |
| 105 | Ready for production rollout next sprint. |
| 106 | Color Status: Green |
| 107 | |
| 108 | Links: |
| 109 | - Blocks: AIPCC-5678 (CI refactoring epic) |
| 110 | - Relates to: RHOAIENG-910 (upstream fix) |
| 111 | |
| 112 | Recent Comments (3): |
| 113 | [2024-03-20] code-samurai: Fix verified in staging, ready to merge |
| 114 | [2024-03-19] super-picky-reviewer: LGTM, approved for merge |
| 115 | [2024-03-18] code-samurai: Initial fix implemented, testing locally |
| 116 | |
| 117 | View in Jira: https://redhat.atlassian.net/browse/AIPCC-1234 |
| 118 | ``` |
| 119 | |
| 120 | ### Step 6: Offer Additional Options |
| 121 | |
| 122 | After displaying the summary, ask if the user wants: |
| 123 | |
| 124 | 1. Full description text |
| 125 | 2. Complete comment history |
| 126 | 3. Raw JSON output |
| 127 | 4. Specific field details |
| 128 | |
| 129 | ### Optional: Store Context |
| 130 | |
| 131 | Store the full ticket context in the conversation for later reference. This allows the user to ask follow-up questions about the ticket without re-fetching data. |
| 132 | |
| 133 | ## Error Handling |
| 134 | |
| 135 | - **acli not found**: Delegate to `acli-setup-check` skill |
| 136 | - **Authentication failure**: Delegate to `acli-setup-check` skill |
| 137 | - **Invalid ticket key**: Verify format and suggest correction |
| 138 | - **Ticket not found**: Verify the ticket exists and user has access |
| 139 | - **Permission denied**: Inform user they may not have access to the ticket or project |
| 140 | - **Network errors**: Report error and suggest retrying |
| 141 | |
| 142 | ## Examples |
| 143 | |
| 144 | ### Basic Usage |
| 145 | |
| 146 | ```text |
| 147 | User: /jira-workitem-view AIPCC-1234 |
| 148 | Assistant: [Fetches and displays formatted ticket details] |
| 149 | ``` |
| 150 | |
| 151 | ### Context Detection |
| 152 | |
| 153 | ```text |
| 154 | User: We need to look at AIPCC-1234 to understand the bug |
| 155 | Assistant: Let me fetch the details for AIPCC-1234... |
| 156 | [Displays ticket information] |