Skip to main content

Auto-Triage Bugs via Linear

Devin auto-investigates bugs the moment a label is applied in Linear.
AuthorCognition
CategoryProject Management
FeaturesIntegrations, Playbooks
1

Write a triage playbook

The automation needs a playbook that tells Devin how your team triages bugs — not just “fix the bug,” but the specific steps an engineer would follow.Start by duplicating the !triage template playbook and customizing it for your stack. Or go to Settings > Playbooks and create a new playbook with the macro !triage-bug. Here’s an example:The more specific your playbook, the better Devin’s triage. Reference your team’s actual patterns — error logging conventions, test frameworks, branch naming rules. See the playbook docs for more on writing effective playbooks, or use Advanced Devin to generate a playbook for you.
Connect the Datadog MCP (or other logging/monitoring services) and give Devin read-only database access so it can check logs, metrics, and query data as part of its investigation.
2

Wire up the automation trigger

Now connect the playbook to Linear so it fires automatically when a bug is labeled.
  1. Go to Settings > Integrations > Linear (connect the integration first if you haven’t — setup guide)
  2. Under Synced playbook labels, click Add playbook and select !triage-bug — this creates a matching label in Linear’s “Devin Playbooks” label group
  3. Scroll to Automation triggers and click Add trigger:
    • Teams: Select the team where bugs are filed (e.g., “Engineering”)
    • Labels: Select Bug (or whichever label your team uses for bug reports)
    • Playbook: Select !triage-bug
  4. Save the trigger
Triggers use edge detection — they only fire when a ticket transitions to matching (e.g., when someone adds the Bug label), not for tickets that already have it. This means you won’t accidentally trigger Devin on your entire existing backlog.
For playbook labels to sync to Linear automatically, your Linear workspace must have Manage workspace labels set to All members (found under Linear’s Settings > Security). If that’s not enabled, you’ll need to create the labels manually in Linear.
3

Label a bug and watch Devin investigate

When an engineer adds the Bug label to a Linear ticket like this:
ENG-487: Users see a 500 error when submitting the contact form on /contact. Started after last Friday’s deploy. Stack trace points to validateEmail() in src/lib/forms.ts.
Devin automatically starts a session and follows your triage playbook:
  • Reads the ticket — pulls the title, description, and any comments from Linear
  • Searches the codebase — finds src/lib/forms.ts, the route handler at src/routes/contact.ts, and the form validation tests
  • Checks recent changes — runs git log --since="last Friday" -- src/lib/forms.ts and spots a commit that refactored the email regex
Devin’s findings are automatically synced back to the Linear ticket via the integration. All of this happens without anyone assigning the ticket to Devin — the label alone triggers the entire workflow.
With the Linear integration installed, Devin natively has access to Linear’s tools — so your playbook can instruct Devin to update ticket labels based on its findings. For example, your triage playbook could tell Devin to add a Clear Fix, Needs Review, or Lacking Context label depending on the outcome. Since labels can trigger other automations, you can chain workflows — e.g., a Clear Fix label could kick off a second Devin session that writes the fix.
4

Sharpen the loop

After a few triages, refine the system based on what Devin gets right and where it needs more guidance.Improve the playbook based on real sessions. If Devin consistently misses something (e.g., not checking logs or missing a related service), add that step to your !triage-bug playbook. You can use Advanced Devin to analyze past sessions and automatically improve your playbook or create Knowledge entries for patterns Devin should follow across all sessions — like “always check the error tracking dashboard first” or “our auth service logs are in CloudWatch, not Datadog.”Add a fix playbook for when you’re ready. Once you trust Devin’s triage, create a second playbook like !fix-bug that goes further — writing a fix, adding a regression test, and opening a PR. Map it to a separate label so your team can choose between “just tell me what’s wrong” and “fix it for me”: