Bug Triage System
Automate bug categorization, priority assignment, and routing with AI agents.
Difficulty: Intermediate Time: 15 minutes
What You'll Build
A flow that:
- Analyzes incoming bug reports
- Categorizes by type (UI, API, Performance, Security, etc.)
- Assigns priority based on severity and impact
- Routes to appropriate team or creates tickets
TBD: Replace with screenshot of the bug triage flow
Prerequisites
Overview
┌──────────┐ ┌───────────┐ ┌──────────┐ ┌────────────┐
│ New Bug │───>│ Analyze │───>│ Prioritize│───>│ Create │
│ Report │ │ Agent │ │ Agent │ │ Ticket │
└──────────┘ └───────────┘ └──────────┘ └────────────┘Step 1: Create the Agents
Bug Analyzer Agent
yaml
name: Bug Analyzer
description: Analyzes bug reports and categorizes them
systemPrompt: |
You are a bug triage specialist. Given a bug report:
1. Identify the type of bug:
- UI/UX: Visual issues, layout problems
- API: Backend errors, data issues
- Performance: Slow responses, memory leaks
- Security: Vulnerabilities, auth issues
- Data: Corruption, sync problems
- Integration: Third-party service issues
2. Extract key information:
- Affected component/feature
- Steps to reproduce
- Expected vs actual behavior
- Environment details
3. Identify any missing information needed for debugging
Return structured analysis that can be used for prioritization.
model: claude-sonnet-5-0
thinkingLevel: think
outputSchema:
type: object
properties:
category:
type: string
enum: [ui, api, performance, security, data, integration, other]
component:
type: string
severity:
type: string
enum: [critical, high, medium, low]
reproducible:
type: boolean
missingInfo:
type: array
items:
type: string
summary:
type: stringPriority Assigner Agent
yaml
name: Priority Assigner
description: Assigns priority and routes bugs
systemPrompt: |
You are responsible for bug prioritization. Given the analysis:
Assign priority based on:
- **Critical**: System down, data loss, security breach
- **High**: Major feature broken, significant user impact
- **Medium**: Feature degraded, workaround exists
- **Low**: Minor issues, cosmetic problems
Consider:
- Number of users affected
- Business impact
- Security implications
- Whether there's a workaround
Recommend the appropriate team:
- frontend: UI/UX issues
- backend: API/data issues
- platform: Performance/infrastructure
- security: Security vulnerabilities
model: claude-sonnet-5-0
thinkingLevel: think
outputSchema:
type: object
properties:
priority:
type: string
enum: [critical, high, medium, low]
team:
type: string
estimatedEffort:
type: string
enum: [small, medium, large]
reasoning:
type: stringStep 2: Build the Flow
- Go to Flows → + New Flow
- Name it "Bug Triage"
Add Nodes
- Trigger Node — "New Bug Report" (Manual or Ticket Created)
- Agent Node — Bug Analyzer
- Agent Node — Priority Assigner
- Condition Node — Check if critical
- Ticket Action Node — Create triaged ticket
- End Node — Done
Connect Nodes
Trigger → Analyzer → Prioritizer → Condition
│
┌─────────────────────────────────┐
[Critical] [Default]
│ │
Notify + Create Create Ticket
High-Pri Ticket │
│ │
└──────── End ─────────────────────┘Configure Agent Nodes
Analyzer node:
yaml
agentId: bug-analyzer
inputMapping:
title: "trigger.input.title"
description: "trigger.input.description"
reporter: "trigger.input.reporter"
outputMapping: {}Prioritizer node:
yaml
agentId: priority-assigner
inputMapping:
analysis: "nodes.analyzer.output"
originalReport: "trigger.input"
outputMapping: {}Configure the Condition
Check if the bug is critical:
yaml
conditions:
- path: "nodes.prioritizer.output.priority"
operator: "eq"
value: "critical"
targetNodeId: "urgent-ticket"
defaultTargetNodeId: "normal-ticket"Step 3: Configure Ticket Creation
For the Ticket Action node:
yaml
action: "create"
actionParams:
title: "trigger.input.title"
priority: "nodes.prioritizer.output.priority"
labels: ["triaged"]For critical bugs, you can also add a second ticket action to link resources or update status:
yaml
action: "add_label"
actionParams:
label: "urgent"Available ticket actions:
| Action | Description |
|---|---|
create | Create a new ticket |
update_status | Change ticket status |
add_comment | Add a comment to a ticket |
add_label | Add a label to a ticket |
link_resource | Link a resource to a ticket |
unlink_resource | Remove a resource link |
link_current_flow_run | Link this flow execution to a ticket |
Step 4: Test the Flow
- Click Run in the flow editor
- Enter a sample bug report:
json
{
"title": "Login page crashes on mobile",
"description": "When I try to log in on my iPhone, the page freezes and then crashes. This happens every time. I'm using Safari on iOS 17.",
"reporter": "user@example.com"
}- Watch the flow categorize, prioritize, and create a ticket
Example Output
After running the flow:
Analyzer Output:
json
{
"category": "ui",
"component": "authentication/login",
"severity": "high",
"reproducible": true,
"missingInfo": ["iOS version", "App version"],
"summary": "Mobile Safari login crash affecting iOS users"
}Prioritizer Output:
json
{
"priority": "high",
"team": "frontend",
"estimatedEffort": "medium",
"reasoning": "Login is critical functionality. Mobile users are blocked from using the app."
}Variations
Add Duplicate Detection
Insert a node before analysis to check for similar existing bugs:
yaml
name: Duplicate Checker
mcpServers:
- sciorex-tickets
systemPrompt: |
Search existing tickets for similar issues.
Return any potential duplicates with similarity score.Add Auto-Assignment
Extend the flow to automatically assign based on team using chained conditions:
yaml
# Condition: Is frontend?
conditions:
- path: "nodes.prioritizer.output.team"
operator: "eq"
value: "frontend"
targetNodeId: "assign-frontend-lead"
defaultTargetNodeId: "check-backend"Integrate with Slack
Add a notification node for critical bugs using a custom MCP server:
yaml
mcpServers:
- slack-mcpTips
- Tune the prompts: Adjust categorization based on your project's structure
- Add context: Include your codebase structure to improve component identification
- Review regularly: Check triage accuracy and refine prompts
- Handle edge cases: Add conditions for incomplete bug reports
- Use debug mode: Step through the flow to verify routing decisions
