You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/rhdh-jira/SKILL.md
+32-6Lines changed: 32 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
name: rhdh-jira
3
3
description: |
4
-
Interact with RHDH Jira projects (RHIDP, RHDHPLAN, RHDHBUGS, RHDHSUPP) using the Atlassian CLI (acli). Use when the user needs to search, create, view, edit, transition, comment on, or link Jira issues for Red Hat Developer Hub. Also use when the user asks about Jira workflows, exit criteria, issue templates, custom fields, boards, sprints, or JQL queries in the RHDH context. Trigger when the user mentions Jira issue keys like RHIDP-1234, RHDHPLAN-567, RHDHBUGS-890, or any RHDH project key. Also trigger for support case bug filing, feature request creation, or release planning in Jira. Covers acli setup, authentication, and troubleshooting.
4
+
Interacts with RHDH Jira projects (RHIDP, RHDHPLAN, RHDHBUGS, RHDHSUPP) using the Atlassian CLI (acli), with REST API and GraphQL fallback for custom field updates and complex queries. Use when the user needs to search, create, view, edit, transition, comment on, or link Jira issues for Red Hat Developer Hub. Also use when the user asks about Jira workflows, exit criteria, issue templates, custom fields, boards, sprints, JQL queries, or Jira API schema discovery. Trigger when the user mentions Jira issue keys like RHIDP-1234, RHDHPLAN-567, RHDHBUGS-890, or any RHDH project key. Also trigger for support case bug filing, feature request creation, release planning, or acli setupand installation.
5
5
compatibility: "acli (Atlassian CLI) on PATH. Python 3 for scripts. Windows, macOS, Linux."
6
6
---
7
7
@@ -20,9 +20,17 @@ python scripts/setup.py
20
20
The script checks:
21
21
1.`acli` binary on PATH
22
22
2. Jira API token auth configured (`~/.config/acli/jira_config.yaml`)
23
-
3. Smoke test against `redhat.atlassian.net`
23
+
3.`.jira-token` file next to `acli` executable (for REST API fallback)
24
+
4. Smoke test against `redhat.atlassian.net`
24
25
25
-
If `acli` is not installed, download from [Atlassian CLI](https://developer.atlassian.com/cloud/acli/). Authenticate with `acli auth login` or configure an API token.
26
+
If `acli` is not installed, download from [Atlassian CLI](https://developer.atlassian.com/cloud/acli/) and follow the [Getting Started guide](https://developer.atlassian.com/cloud/acli/guides/how-to-get-started/) for installation and authentication setup. Use API token authentication, not OAuth — OAuth sessions expire and `acli auth status` gives false negatives with token auth (see Gotchas).
27
+
28
+
### REST/GraphQL capability gate
29
+
30
+
Before attempting any REST API or GraphQL call:
31
+
1. Run `python scripts/setup.py --json` and check `token_file_found`
32
+
2. If missing, state: "REST API/GraphQL fallback unavailable — `.jira-token` not configured. Run `setup.py` for instructions." Continue with acli-only workflow.
33
+
3. If the user needs REST/GraphQL, load `references/auth.md` for setup instructions
26
34
27
35
## Scripts
28
36
@@ -64,6 +72,9 @@ Load only what the current task requires.
64
72
|`references/templates.md`| Creating new issues. Also load `references/workflows.md` for required fields at entry status. |
65
73
|`references/support.md`| Handling support cases, filing bugs from customer cases, or creating feature requests from support. |
66
74
|`references/jql-patterns.md`| Building a JQL query, finding a board ID, or looking up sprint information. JQL cookbook with 23+ tested queries. |
75
+
|`references/auth.md`| Setting up authentication for REST API or GraphQL calls. Token file format, path discovery, security, instance config, common auth errors. |
76
+
|`references/rest-api-fallback.md`|`acli` failed to update a custom field (Team, Size, Story Points, Release Note Type). Curl examples, response handling, OpenAPI spec discovery. |
77
+
|`references/graphql-queries.md`| Complex read queries needing multiple fields, relationships, or custom field data in one call. Schema introspection, JQL search via GraphQL, field type fragments. |
67
78
68
79
## Common Gotchas
69
80
@@ -75,19 +86,23 @@ Load only what the current task requires.
75
86
6.**ADF vs plain text.** Reading descriptions via `--json` returns Atlassian Document Format (nested JSON). Creating/editing with `--description` accepts plain text. Don't try to round-trip ADF through `--description`.
76
87
7.**Acceptance Criteria field is almost always null.** Scan the description for "Requirements", "Acceptance Criteria", or bullet-style criteria instead of checking `customfield_10718`.
77
88
8.**`--enrich` is MANDATORY for custom fields.** Both `acli search --json` and `acli view KEY --json` (without `--fields "*all"`) return only basic fields (assignee, issuetype, priority, status, summary). Story points, team, sprint, and size will appear as empty/null — looking like the data isn't set when it actually is. Always use `scripts/parse_issues.py --enrich` to get custom field data. Skipping `--enrich` is the #1 cause of false "missing data" reports.
78
-
9.**`acli sprint list-workitems --json` wraps results in `{"issues": [...]}`.** The output is NOT a flat array — it's an object with an `issues` key. Extract the array before piping to `parse_issues.py`. See `references/acli-commands.md` for the workaround command.
89
+
9.**Custom fields may fail to update via `acli`.**`acli jira workitem edit` can silently fail or error when setting custom fields (Team, Size, Story Points). When an `acli edit` for a custom field fails, fall back to the Jira REST API. Find the token file at `.jira-token` next to the `acli` executable (discover the path with `readlink -f "$(which acli)"` or `where acli`). Read `references/rest-api-fallback.md` for curl examples and payload formats. Never read the token file into context.
90
+
10.**`acli sprint list-workitems --json` wraps results in `{"issues": [...]}`.** The output is NOT a flat array — it's an object with an `issues` key. Extract the array before piping to `parse_issues.py`. See `references/acli-commands.md` for the workaround command.
91
+
11.**GraphQL search is beta.**`issueSearchStable` requires `X-ExperimentalApi: JiraIssueSearch` header. Load `references/graphql-queries.md` before attempting GraphQL queries.
92
+
12.**`.jira-token` format is `email:token`, not bare token.** A file containing only the API token without the email prefix will cause 401 errors on REST/GraphQL calls. The `setup.py` script validates the format.
79
93
80
94
## Error Handling
81
95
82
96
| Error | Action |
83
97
|-------|--------|
84
-
|`acli` not on PATH | Run `scripts/setup.py`. Install from Atlassian if missing. |
98
+
|`acli` not on PATH | Run `scripts/setup.py`. Install from Atlassian if missing. See [Getting Started](https://developer.atlassian.com/cloud/acli/guides/how-to-get-started/). |
85
99
| "unauthorized" from `auth status`| Ignore. Check `jira_config.yaml` exists. Run smoke test. |
86
100
| "required flag(s) not set" | Command syntax wrong. Run `acli jira <subcommand> --help`. |
87
101
| "field X is not allowed" | Use `--json` instead of `--fields` for that field. |
88
102
| "the value X does not exist for the field 'project'" | Project key is wrong or project is archived (e.g., RHDHPAI). |
| Interactive prompt hangs | Missing `--yes` flag on a mutating command. |
105
+
| Custom field update fails via `acli`| Fall back to Jira REST API using `.jira-token` file. See Gotcha #9. |
91
106
92
107
## Common Workflows
93
108
@@ -106,7 +121,18 @@ Load only what the current task requires.
106
121
2. Verify required fields are set before transitioning
107
122
3. Run `acli jira workitem transition --key KEY --status "X" --yes`
108
123
124
+
### Complex queries (many fields, relationships)
125
+
1. Load `references/graphql-queries.md`
126
+
2. Use `issueByKey` for single issues or `issueSearchStable` (beta) for JQL search
127
+
3. Fall back to `acli` + `parse_issues.py --enrich` if GraphQL returns errors
128
+
129
+
### Discovering unknown fields or endpoints
130
+
1. For REST: load `references/rest-api-fallback.md` — use the OpenAPI spec or `/rest/api/3/field` endpoint
131
+
2. For GraphQL: load `references/graphql-queries.md` — use `__type` introspection queries
132
+
3. Do not guess field IDs or types — always verify against the live schema
133
+
109
134
## When NOT to Use
110
135
111
136
-**Non-RHDH Jira projects** — this skill's field mappings, workflows, and JQL patterns are specific to RHIDP/RHDHPLAN/RHDHBUGS/RHDHSUPP
112
-
-**Jira REST API directly** — this skill covers `acli` CLI only
137
+
-**Jira REST API directly** — use `acli` first. REST API is a fallback for custom field updates and schema discovery when `acli` cannot handle the operation (see Gotcha #9)
138
+
-**GraphQL for simple lookups** — use `acli` for single-issue views and simple searches. GraphQL is for complex queries needing relationships or many custom fields in one call, and for schema introspection
| 401 on REST/GraphQL calls |`.jira-token` is bare token without email prefix | Format must be `email:token`|
61
+
| 401 after token was working | API token expired or revoked | User must regenerate at Atlassian account settings |
62
+
|`acli auth status` says unauthorized | False negative — `auth status` checks OAuth, not API tokens | Ignore. Use `acli jira project list --recent 1` as smoke test |
63
+
|`.jira-token` not found | File is next to symlink, not the real binary |`setup.py` uses `resolve()` to follow symlinks — place file next to real binary |
0 commit comments