Jira Hygiene
Validates and fixes Jira issues for quality and completeness. Resolves project/component from issue_key prefix or repo_name.
Inputs
| Input |
Type |
Default |
Purpose |
issue_key |
string |
required |
Jira issue key (e.g., AAP-12345) |
repo_name |
string |
- |
Repository name for component resolution |
auto_fix |
bool |
true |
Automatically fix issues where possible |
auto_transition |
bool |
true |
Auto-transition New → Refinement when ready |
epic_key |
string |
- |
Epic key to link issue to (e.g., AAP-50000) |
story_points |
int |
- |
Story points to set |
priority |
string |
- |
Priority to set (e.g., Major) |
Workflow
1. Load Persona
persona_load(persona="developer") — Jira tools require developer persona
2. Knowledge & Known Issues
knowledge_query(project="automation-analytics-backend", persona="developer", section="patterns.coding") — Jira best practices
check_known_issues(tool_name="jira_view_issue", error_text="") — Check for known Jira failures
3. Lint & Fetch Issue
jira_lint(issue_key=issue_key) — Run automated quality checks
jira_view_issue_json(issue_key=issue_key) — Fetch full issue details
4. Validate Issue
Parse issue fields and check:
- Description: Must exist, ≥20 chars, proper formatting (h2., bullets, code blocks)
- Acceptance criteria: Must exist, ≥10 chars
- Priority: Must be set (default: Normal)
- Labels/Components: At least one required
- Epic link: Required for stories/tasks
- Fix version: Warn if missing
- Story points: Required for In Progress/Review issues
- Transition: If status=New and has desc+AC+priority → ready for Refinement
5. Flag Blocked (if applicable)
If issue description contains "block":
jira_block(issue_key=issue_key, reason="Blocker detected during hygiene check")
6. Auto-Fix (when auto_fix=true)
Apply fixes in order:
- Status:
jira_set_status(issue_key=issue_key, status="Refinement") — if transition_ready and auto_transition
- Priority:
jira_set_priority(issue_key=issue_key, priority=value) — if missing (or from inputs.priority)
- Epic:
jira_set_epic(issue_key=issue_key, epic_key=epic_key) — if inputs.epic_key provided
- Story points:
jira_set_story_points(issue_key=issue_key, points=points) — if inputs.story_points provided
7. Report & Memory
- Build health score (0–100%) from validation
memory_session_log(action="Hygiene check on {issue_key}", details="Healthy" or "N issues found")
- If validation.needs_input: add follow-up to
state/current_work
8. Learning from Failures
- If "issue does not exist":
learn_tool_fix("jira_view_issue", "issue does not exist", "Jira issue key incorrect or deleted", "Verify format AAP-12345")
- If "unauthorized" or "401":
learn_tool_fix("jira_view_issue", "unauthorized", "Jira auth failed", "Check Jira credentials")
Output Format
## 🟢/🟡/🟠/🔴 Issue Health: X%
**Issue:** AAP-12345
**Summary:** ...
**Status:** ...
### Issues Found
- ❌ Missing acceptance criteria
### ✅ Fixed
- ✅ Priority
### ❓ Needs Your Input
**epic_link:** Story should be linked to an Epic → Please specify which Epic
Key MCP Tools
persona_load, jira_lint, jira_view_issue_json, jira_set_status, jira_set_priority, jira_set_epic, jira_set_story_points, jira_block, memory_session_log, learn_tool_fix, knowledge_query, check_known_issues
1---2name: jira-hygiene3description: Check and fix Jira issue hygiene - ensures issues have proper details, acceptance criteria, priority, labels, epic links, and formatting. Transitions New issues to Refinement when complete. Use when user says "Jira hygiene", "fix issue details", or "check AAP-XXXXX".4---56# Jira Hygiene78Validates and fixes Jira issues for quality and completeness. Resolves project/component from issue_key prefix or repo_name.910## Inputs1112| Input | Type | Default | Purpose |13|-------|------|---------|---------|14| `issue_key` | string | required | Jira issue key (e.g., AAP-12345) |15| `repo_name` | string | - | Repository name for component resolution |16| `auto_fix` | bool | true | Automatically fix issues where possible |17| `auto_transition` | bool | true | Auto-transition New → Refinement when ready |18| `epic_key` | string | - | Epic key to link issue to (e.g., AAP-50000) |19| `story_points` | int | - | Story points to set |20| `priority` | string | - | Priority to set (e.g., Major) |2122## Workflow2324### 1. Load Persona25- `persona_load(persona="developer")` — Jira tools require developer persona2627### 2. Knowledge & Known Issues28- `knowledge_query(project="automation-analytics-backend", persona="developer", section="patterns.coding")` — Jira best practices29- `check_known_issues(tool_name="jira_view_issue", error_text="")` — Check for known Jira failures3031### 3. Lint & Fetch Issue32- `jira_lint(issue_key=issue_key)` — Run automated quality checks33- `jira_view_issue_json(issue_key=issue_key)` — Fetch full issue details3435### 4. Validate Issue36Parse issue fields and check:37- **Description**: Must exist, ≥20 chars, proper formatting (h2., bullets, code blocks)38- **Acceptance criteria**: Must exist, ≥10 chars39- **Priority**: Must be set (default: Normal)40- **Labels/Components**: At least one required41- **Epic link**: Required for stories/tasks42- **Fix version**: Warn if missing43- **Story points**: Required for In Progress/Review issues44- **Transition**: If status=New and has desc+AC+priority → ready for Refinement4546### 5. Flag Blocked (if applicable)47If issue description contains "block":48- `jira_block(issue_key=issue_key, reason="Blocker detected during hygiene check")`4950### 6. Auto-Fix (when auto_fix=true)51Apply fixes in order:52- **Status**: `jira_set_status(issue_key=issue_key, status="Refinement")` — if transition_ready and auto_transition53- **Priority**: `jira_set_priority(issue_key=issue_key, priority=value)` — if missing (or from inputs.priority)54- **Epic**: `jira_set_epic(issue_key=issue_key, epic_key=epic_key)` — if inputs.epic_key provided55- **Story points**: `jira_set_story_points(issue_key=issue_key, points=points)` — if inputs.story_points provided5657### 7. Report & Memory58- Build health score (0–100%) from validation59- `memory_session_log(action="Hygiene check on {issue_key}", details="Healthy" or "N issues found")`60- If validation.needs_input: add follow-up to `state/current_work`6162### 8. Learning from Failures63- If "issue does not exist": `learn_tool_fix("jira_view_issue", "issue does not exist", "Jira issue key incorrect or deleted", "Verify format AAP-12345")`64- If "unauthorized" or "401": `learn_tool_fix("jira_view_issue", "unauthorized", "Jira auth failed", "Check Jira credentials")`6566## Output Format6768```markdown69## 🟢/🟡/🟠/🔴 Issue Health: X%70**Issue:** AAP-1234571**Summary:** ...72**Status:** ...73### Issues Found74- ❌ Missing acceptance criteria75### ✅ Fixed76- ✅ Priority77### ❓ Needs Your Input78**epic_link:** Story should be linked to an Epic → Please specify which Epic79```8081## Key MCP Tools8283- `persona_load`, `jira_lint`, `jira_view_issue_json`, `jira_set_status`, `jira_set_priority`, `jira_set_epic`, `jira_set_story_points`, `jira_block`, `memory_session_log`, `learn_tool_fix`, `knowledge_query`, `check_known_issues`