/jira:validate-bug runs instead · from jira
Validates JIRA bugs on PRs by running the same 7 checks as the jira-lifecycle-plugin. Diagnoses and fixes jira/invalid-bug labels on OpenShift PRs.
This skill never runs in Claude Code
It ships in jira at skills/, but /jira:validate-bug (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
IMPORTANT FOR AI: This is a procedural skill. Execute each phase in order. Do not skip steps. Do not invent field IDs — use only the documented custom field IDs below.
This skill replicates the validation logic of the jira-lifecycle-plugin (Prow external plugin) that applies the jira/invalid-bug label to PRs in OpenShift repositories.
| Field | Custom Field ID | JQL Name |
|---|---|---|
| Target Version | customfield_10855 | "Target Version" |
| Release Note Text | customfield_10783 | — |
| Release Note Type | customfield_10785 | — |
| Severity | customfield_10840 | — |
The jira-lifecycle-plugin runs these checks in order. A bug must pass ALL checks to get jira/valid-bug.
| # | Check | What it validates |
|---|---|---|
| 1 | Bug is open | Status is not "Closed" |
| 2 | Target version matches branch | Bug's Target Version matches the expected version for the PR's base branch |
| 3 | Bug in valid state | Status is one of: NEW, ASSIGNED, POST |
| 4 | Release notes set | Release note text is non-empty and doesn't match the default template, OR release note type is "Release Note Not Required" |
| 5 | Dependent bug states | Each dependent (linked via "Blocks") is in an allowed state |
| 6 | Dependent bug target versions | Each dependent targets an allowed version |
| 7 | Dependents exist | At least one "Blocks" link exists to a bug in the same project |
Checks 5-7 only apply to release branches (release-4.X), not main/master.
The plugin config follows a mechanical pattern:
Target version (what the bug on the PR's branch must target):
release-4.X → 4.X.z (prefix match — 4.X.0 also accepted)main / master → 5.0.0 (prefix match — 5.0 also accepted). Update when main targets a new major version — check openshift/release/core-services/jira-lifecycle-plugin/config.yaml for the current value.Dependent target version (what the "Blocks" linked bug must target):
release-4.X → 4.(X+1).0 or 4.(X+1).zValid states for the bug itself (all branches):
NEW, ASSIGNED, POSTValid states for dependent bugs (varies by branch — check openshift/release/core-services/jira-lifecycle-plugin/config.yaml for current boundaries):
release-4.22 and newer: MODIFIED, ON_QA, VERIFIEDrelease-4.6 through release-4.21: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA)Dependent bug checks (checks 5-7):
release-4.X branchesmain / master (config sets exclude_defaults: true)Release notes:
require_release_notes: true)"Cause: What actions or circumstances cause this bug to present.\r\nConsequence: What happens when the bug presents.\r\nFix: What was done to fix the bug.\r\nResult: Bug doesn't present anymore."gh CLI authenticated with GitHubcloudId: use redhat.atlassian.netParse the argument to determine input type:
PR URL — matches https://github.com/{org}/{repo}/pull/{number}
gh pr view {number} --repo {org}/{repo} --json title,baseRefName,state[A-Z]+-[0-9]+ (e.g., OCPBUGS-85778)baseRefName (e.g., release-4.20, main)PR number — plain integer
gh repo view --json nameWithOwner -q .nameWithOwnerJIRA key — matches [A-Z]+-[0-9]+
--branch argument (no PR context to infer branch)--branch not provided, error: "JIRA key input requires --branch (e.g., --branch release-4.20)"Validate the JIRA key project:
OCPBUGS, DFBUGS, or PROJQUAYCompute expected values from branch:
expected_target_version, expected_dependent_versions, valid_states, dependent_valid_states, dependents_required using the mapping aboveFetch the primary bug:
Call executeRead with name: "getJiraIssue", cloudId, and the rest in inputs — the primary getJiraIssue tool's schema omits view, so schema-validating clients drop it silently and return no issuelinks:
cloudId: redhat.atlassian.netinputs.issueIdOrKey: the JIRA keyinputs.view: evidence (required for issuelinks — the compact view drops it even when requested)inputs.fields: ["summary", "status", "issuetype", "fixVersions", "issuelinks", "customfield_10855", "customfield_10783", "customfield_10785", "customfield_10840", "labels", "components"]inputs.responseContentFormat: markdownExtract key data from response:
status.name — bug status (e.g., "New", "Verified")customfield_10855 — Target Version array (each entry has .name)customfield_10783 — Release Note Text (string or ADF doc)customfield_10785 — Release Note Type (object with .value)issuelinks — array of issue linksFind dependent bugs:
Filter issuelinks for links where:
"Blocks" AND direction is outwardIssue (this bug blocks the dependent)OCPBUGS-*)For each dependent found:
getJiraIssue:
fields: ["summary", "status", "customfield_10855", "fixVersions"]Run each check and record the result:
results = []
Check 1: Bug is open
status.name is NOT "Closed"status.name is "Closed""bug is open, matching expected state (open)""bug is closed, expected it to be open"Check 2: Target version matches branch
customfield_10855 (array)"expected the bug to target the '{expected}' version, but no target version was set".name starts with the expected prefix (e.g., "4.20" for release-4.20)"expected the bug to target either version '{expected}' or 'openshift-{expected}', but it targets '{actual}' instead"Check 3: Bug in valid state
status.name (uppercased) is in ["NEW", "ASSIGNED", "POST"]"bug is in state {actual}, which is not one of the valid states (NEW, ASSIGNED, POST)"Check 4: Release notes
customfield_10783
customfield_10785.value equals "Release Note Not Required""Cause: What actions or circumstances""release note text must be set and not match the template OR release note type must be set to 'Release Note Not Required'"Check 5: Dependent bug states (skip if dependents_required is false)
status.name (uppercased) is in the allowed dependent_valid_states list"expected dependent Jira Issue {key} to be in one of the following states: {allowed}, but it is {actual} instead"Check 6: Dependent bug target versions (skip if dependents_required is false)
customfield_10855expected_dependent_versions prefixes"expected dependent Jira Issue {key} to target a version in {allowed}, but it targets '{actual}' instead"Check 7: Dependents exist (skip if dependents_required is false)
"expected Jira Issue to depend on a bug targeting a version in {allowed} and in one of the following states: {allowed_states}, but no dependents were found"Render results as a markdown table:
## Validating {JIRA_KEY} against branch {BRANCH}
**Bug**: {summary}
**Status**: {status} | **Target Version**: {target_version} | **Project**: {project}
| # | Check | Expected | Actual | Result |
|---|--------------------------------|-------------------------|--------------------| -------|
| 1 | Bug is open | Open | {status} | {P/F} |
| 2 | Target version | {expected_tv} | {actual_tv} | {P/F} |
| 3 | Valid state | NEW/ASSIGNED/POST | {status} | {P/F} |
| 4 | Release notes | Set (not template) | {actual_rn} | {P/F} |
| 5 | Dependent bug states | {allowed_states} | {actual_dep_state} | {P/F} |
| 6 | Dependent bug target version | {allowed_dep_tv} | {actual_dep_tv} | {P/F} |
| 7 | Dependents exist | At least one | {count} found | {P/F} |
Result: {N} of 7 checks passed
For checks that were skipped (main branch, no dependents required), show SKIP in the Result column.
For each failure, list the specific fix instruction:
### Fixes needed
1. **Target version**: Set Target Version to `{expected}` (currently `{actual}`)
2. **Status**: Transition to NEW, ASSIGNED, or POST (currently `{actual}`)
3. **Release notes**: Set release note text or set Release Note Type to "Release Note Not Required"
4. **Dependents**: Create or link a bug in {PROJECT} targeting `{expected_dep_version}`
If all checks pass:
All 7 checks passed. If the PR still shows `jira/invalid-bug`, comment `/jira refresh` on the PR.
After reporting, offer to fix each failing check. List the fixes and ask for confirmation before proceeding.
Fix: Target version (checks 2, 6)
executeRead with name: "getJiraIssueTypeMetaWithFields", projectIdOrKey: {PROJECT}, issueTypeId from the bug's issuetype.id, and requiredFieldsOnly: falsecustomfield_10855 in the response fields — its allowedValues array contains all available versions. Match the entry whose .name equals the expected version string (e.g., 4.20.z) and extract its .ideditJiraIssue with fields: {"customfield_10855": [{"id": "{version_id}"}]}Fix: Status (checks 1, 3)
executeRead with name: "listJiraIssueTransitions" and the issue keytransitionJiraIssue with the transition IDFix: Release notes (check 4)
Cause: {what causes the bug}
Consequence: {what happens}
Fix: {what was done}
Result: {the fix resolves it}
editJiraIssue with fields: {"customfield_10783": "{text}"}fields: {"customfield_10785": {"value": "Release Note Not Required"}}Fix: Missing dependents (check 7)
issuelinks (same project, outward direction)executeWrite with name: "createJiraIssueLink", linkType: "Blocks", inwardIssue: {original_bug}, outwardIssue: {new_bug} (original bug blocks the new dependent)createJiraIssue, then call executeWrite with name: "createJiraIssueLink"Fix: Dependent bug state (check 5)
executeRead with name: "listJiraIssueTransitions" for the dependenttransitionJiraIssueAfter all fixes applied:
/jira refresh on the PR to have the bot re-validate."| Error | Handling |
|---|---|
| PR not found | Display error with PR URL, suggest checking the URL |
| No JIRA key in PR title | Display the PR title, explain the expected format: {JIRA-KEY}: description |
| JIRA issue not found | Check if key is correct, check project access |
| MCP tool unavailable | Fall back to gh CLI for GitHub data; for JIRA, display manual fix instructions |
| Branch not recognized | Warn that branch {name} doesn't match expected patterns, ask for --branch override |
| Version ID not found | Display the expected version string, instruct user to set it manually in JIRA |
| Transition not available | List available transitions, explain which one is needed and why it might be blocked |
openshift/release/core-services/jira-lifecycle-plugin/config.yaml. If validation rules change, update the mapping in this skill.jira/valid-bug, the bot will not remove it.main branch uses exclude_defaults: true, which disables dependent bug checks (5-7).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub openshift-eng/ai-helpers --plugin jira14 skills in this plugin
/catch-me-upGather and classify recent Jira activity to surface what needs attention/categorize-activity-typesCategorize Jira issues into Red Hat Sankey Activity Type categories using MCP Jira tools. Supports single-issue and batch modes. Use when the user wants to categorize or set activity types on Jira issues, or mentions activity types, work types, Sankey, or capacity allocation./createCreate Jira issues — story, bug, epic, feature, initiative, task, risk, spike, or feature-request — with CNTRLPLANE, OCPBUGS, GCP, HyperShift, ARO, ROSA conventions and type-specific templates/create-release-noteDetailed implementation guide for generating bug fix release notes from Jira and GitHub PRs/extract-prsRecursively extract GitHub Pull Request links from Jira issues/generate-enhancementGenerate OpenShift enhancement proposal markdown from Jira epic or feature contentOther plugins' skills for the same job