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: workflows/acs-triage/.ambient/ambient.json
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,12 @@
4
4
"config": {
5
5
"jira": {
6
6
"project": "ROX",
7
-
"filter": 103399
7
+
"jql": "project = ROX AND (type = Bug OR type = Vulnerability OR type = Weakness OR type = Ticket) AND status = New AND parent is EMPTY AND Team is EMPTY AND assignee is EMPTY AND labels NOT IN (auto-triaged) ORDER BY created",
8
+
"autoTriagedLabel": "auto-triaged"
8
9
},
9
10
"timeout": 300,
10
11
"maxIssues": 20
11
12
},
12
-
"systemPrompt": "You are an ACS/StackRox Triage Specialist. Execute the `/triage` command for complete end-to-end pipeline (setup → fetch → classify → analyze → assign → report) or `/triage --comment` to post results to JIRA.\n\n**Key Commands:** `/triage` (filter 103399), `/triage ROX-12345` (specific issue), `/triage --comment` (writes to JIRA), `/comment-issues` (standalone commenting)\n\n**Early Exit:** If filter 103399 returns 0 issues, exit immediately with \"No untriaged issues found\" (don't proceed with empty pipeline).\n\n**Duplicate Prevention:** Before posting comments (--comment flag), check if issue already has a triage comment (search for \"🤖 Automated Triage Analysis\" or \"_Generated by ACS Triage Workflow_\"). Skip if already triaged.\n\n**Workflow Details:** See `.claude/commands/triage.md` for complete 7-phase pipeline. **CRITICAL:** Phases 1a+1b run in parallel, Phase 4 analysis MUST use parallel tool calls (saves 60-80s).\n\n**Domain Knowledge:** Consult `reference/*.md` files for teams, error patterns, CODEOWNERS mappings, vulnerability decision trees, and confidence thresholds. Team assignment uses 5-strategy priority system (95%-70% confidence).\n\n**Performance:** Load files once and cache. Primary JIRA query in Phase 1b. Max 3-5 additional batched queries for similar issue searches. See triage.md Performance Optimization Guidelines.\n\n**Constraints:** 300s timeout, 10-20 issues max, ≥80% confidence for auto-assignment, READ-ONLY by default.\n\n**Outputs:** All artifacts in `artifacts/acs-triage/` (setup-info.json, issues.json, triage-report.md, summary.json).\n\nFor complete documentation, see `CLAUDE.md`.",
13
-
"startupPrompt": "Greet the user and introduce yourself as an ACS Triage Specialist. Briefly explain that you execute automated triage for StackRox/ACS JIRA issues from filter 103399 (CI failures, vulnerabilities, flaky tests) and generate comprehensive reports with intelligent team assignments using confidence scoring. Explain the available commands: `/triage` (complete pipeline, READ-ONLY), `/triage --comment` (pipeline + post to JIRA), `/comment-issues` (standalone comment posting). Mention the workflow is streamlined into a single command that handles everything: fetch → classify → analyze → assign → report."
13
+
"systemPrompt": "You are an ACS/StackRox Triage Specialist. Execute the `/triage` command for complete end-to-end pipeline (setup → fetch → classify → analyze → assign → report) or `/triage --comment` to post results to JIRA.\n\n**Key Commands:** `/triage` (JQL search for untriaged), `/triage ROX-12345` (specific issue), `/triage --comment` (writes to JIRA + adds auto-triaged label), `/comment-issues` (standalone commenting)\n\n**JQL Search:** Fetches issues matching: `project = ROX AND (type = Bug OR type = Vulnerability OR type = Weakness OR type = Ticket) AND status = New AND parent is EMPTY AND Team is EMPTY AND assignee is EMPTY AND labels NOT IN (auto-triaged) ORDER BY created`\n\n**Early Exit:** If JQL search returns 0 issues, exit immediately with \"No untriaged issues found\" (don't proceed with empty pipeline).\n\n**Label-Based Idempotency:** After posting triage comment, add `auto-triaged` label to issue. This prevents re-processing on subsequent runs. Workflow is fully idempotent and safe to run frequently.\n\n**Workflow Details:** See `.claude/commands/triage.md` for complete 7-phase pipeline. **CRITICAL:** Phases 1a+1b run in parallel, Phase 4 analysis MUST use parallel tool calls (saves 60-80s).\n\n**Domain Knowledge:** Consult `reference/*.md` files for teams, error patterns, CODEOWNERS mappings, vulnerability decision trees, and confidence thresholds. Team assignment uses 5-strategy priority system (95%-70% confidence).\n\n**Performance:** Load files once and cache. Primary JIRA query in Phase 1b. Max 3-5 additional batched queries for similar issue searches. See triage.md Performance Optimization Guidelines.\n\n**Constraints:** 300s timeout, 10-20 issues max, ≥80% confidence for auto-assignment, READ-ONLY by default.\n\n**Outputs:** All artifacts in `artifacts/acs-triage/` (setup-info.json, issues.json, triage-report.md, summary.json).\n\nFor complete documentation, see `CLAUDE.md`.",
14
+
"startupPrompt": "Greet the user and introduce yourself as an ACS Triage Specialist. Briefly explain that you execute automated triage for StackRox/ACS JIRA issues (CI failures, vulnerabilities, flaky tests) and generate comprehensive reports with intelligent team assignments using confidence scoring. Explain the available commands: `/triage` (complete pipeline, READ-ONLY), `/triage --comment` (pipeline + post to JIRA + add auto-triaged label), `/comment-issues` (standalone comment posting). Mention the workflow uses JQL search to find new untriaged issues (excludes issues with auto-triaged label), making it safe to run repeatedly."
-**CRITICAL:** If filter returns 0 issues, exit immediately with message: "No untriaged issues found in filter 103399. Triage complete."
62
+
-**CRITICAL:** If JQL search returns 0 issues, exit immediately with message: "No untriaged issues found. All issues either have auto-triaged label or don't match criteria. Triage complete."
63
+
64
+
**Label Exclusion:** Issues with `auto-triaged` label are excluded from search, ensuring idempotent workflow execution.
52
65
53
66
**Output:** Raw issue data in `artifacts/acs-triage/issues.json`
54
67
@@ -190,21 +203,25 @@ Create output reports in two formats.
190
203
}
191
204
```
192
205
193
-
### Phase 7: Comment to JIRA (Optional)
206
+
### Phase 7: Comment to JIRA and Add Label (Optional)
194
207
Only if `--comment` flag is provided.
195
208
196
209
**Actions:**
197
210
- For each issue with confidence ≥80%:
198
-
-**Check if already triaged:** Search issue comments for "🤖 Automated Triage Analysis" or "_Generated by ACS Triage Workflow_"
199
-
-**Skip if already triaged:** If existing triage comment found, do not post duplicate
200
-
-**Post comment:** If not previously triaged, post structured comment with team recommendation, confidence, reasoning
201
-
- Use comment format from `templates/jira-comment.md`
211
+
-**Post comment:** Post structured comment with team recommendation, confidence, reasoning
212
+
- Use comment format from `templates/jira-comment.md`
213
+
- Use `mcp__mcp-atlassian__jira_add_comment`
214
+
-**Add label:** After successful comment post, add `auto-triaged` label to the issue
215
+
- Use `mcp__mcp-atlassian__jira_update_issue` with `labels` parameter
216
+
- Append to existing labels (don't replace)
217
+
- Example: `{"labels": ["auto-triaged"]}`
218
+
-**Log:** Record issue key, team, confidence, comment status, and label status
202
219
- Skip issues with low confidence (<80%)
203
-
- Log all posted comments and skipped issues (with reason)
220
+
- Log all posted comments, labels added, and skipped issues (with reason)
204
221
205
222
**Comment Template:** See `templates/jira-comment.md` for format and variable substitution.
206
223
207
-
**Duplicate Prevention:**Never post multiple triage comments to the same issue. Check existing comments first.
224
+
**Idempotency:**Issues with `auto-triaged` label are excluded in Phase 1b search. This workflow is safe to run repeatedly - only new untriaged issues will be processed.
208
225
209
226
## Output
210
227
@@ -249,9 +266,9 @@ After running this command, you should have:
249
266
250
267
## Error Handling
251
268
252
-
-**Empty filter results**: Exit immediately with "No untriaged issues found" message (don't proceed)
269
+
-**Empty search results**: Exit immediately with "No untriaged issues found" message (don't proceed)
253
270
-**Issue not found**: If specific issue key provided but doesn't exist, exit with error
254
-
-**Already triaged**: If `--comment` flag and issue already has triage comment, skip posting (log as "Already triaged")
271
+
-**Label application failure**: If comment posted but label add fails, log warning (issue may be re-triaged on next run - safe idempotency)
255
272
-**JIRA timeout**: Process what you have, note incomplete in report
256
273
-**Unknown issue type**: Mark as UNKNOWN, include raw description for manual triage
257
274
-**No team match**: Use "Needs Manual Assignment" with evidence summary
@@ -266,8 +283,9 @@ After running this command, you should have:
266
283
- Load reference files (CODEOWNERS, error-signatures.md, etc.) once and cache in memory
267
284
268
285
**JIRA Queries:**
269
-
- Primary fetch: ONE query for filter 103399 (Phase 1b)
-`/triage --comment` - Full triage pipeline + post analysis comments to JIRA (⚠️ WRITES to JIRA)
21
+
-`/triage --comment` - Full triage pipeline + post analysis comments to JIRA + add auto-triaged label (⚠️ WRITES to JIRA)
22
22
-`/comment-issues` - Standalone command to add triage comments to JIRA (requires prior /triage run)
23
23
24
24
**Simplified Design:** All triage steps are consolidated into a single `/triage` command for ease of use.
25
25
26
+
**Idempotent Execution:** The workflow uses JQL search with `labels NOT IN (auto-triaged)` exclusion. After triaging an issue and posting a comment, the `auto-triaged` label is added. This makes the workflow safe to run repeatedly - only new untriaged issues will be processed.
27
+
26
28
## Directory Structure
27
29
28
30
```
@@ -75,7 +77,8 @@ The workflow is configured in `.ambient/ambient.json`:
75
77
"config": {
76
78
"jira": {
77
79
"project": "ROX",
78
-
"filter": 103399
80
+
"jql": "project = ROX AND (type = Bug OR type = Vulnerability OR type = Weakness OR type = Ticket) AND status = New AND parent is EMPTY AND Team is EMPTY AND assignee is EMPTY AND labels NOT IN (auto-triaged) ORDER BY created",
81
+
"autoTriagedLabel": "auto-triaged"
79
82
},
80
83
"timeout": 300,
81
84
"maxIssues": 20
@@ -85,6 +88,8 @@ The workflow is configured in `.ambient/ambient.json`:
85
88
86
89
**Simplified Execution**: The `/triage` command internally handles all phases sequentially, with parallel execution for type-specific analysis (CI/vuln/flaky) to save 60-80 seconds.
87
90
91
+
**Idempotent Design**: Uses JQL search to exclude issues with `auto-triaged` label. After triage+comment, label is added to prevent re-processing.
92
+
88
93
## Version Mismatch Handling
89
94
90
95
The triage workflow clones latest `main` branch from StackRox repo. Issues with older `affectedVersions` may have:
0 commit comments