Triage new Jira bugs with AI
This guide builds a first pass of bug triage. When someone files a bug in your Jira project, the workflow reads the report, decides which team owns it and what priority it needs, and then:
- sets the issue’s priority in Jira,
- adds a comment that explains the decision,
- assigns the issue to the owning team’s lead, and
- posts the bug in that team’s Slack channel.
When the report doesn’t say enough to decide, the workflow posts it in a triage channel for a person to look at instead.
The finished workflow has these steps:
Before you start
Section titled “Before you start”- You need the Developer role in a KloudMate workspace whose plan includes workflows.
- You need a Jira Cloud connection and a Slack connection, both with the Workflows capability. Invite the KloudMate bot to each team’s Slack channel, and to a channel for bugs that need a person.
- Note your Jira project key, such as
APP, and the email address of each team’s lead. - Each run uses workflow credits, and the AI Extract step uses more. See Check workflow usage.
Step 1: Save your Jira address as a variable
Section titled “Step 1: Save your Jira address as a variable”The Slack messages link to each bug. Open Workflows → Variables and create a Constant named jira_url, with your Jira site’s address as its value, such as https://acme.atlassian.net.
Step 2: Import the workflow
Section titled “Step 2: Import the workflow”- Copy the YAML below, and make these changes:
- In the trigger’s
jql, replaceAPPwith your project key. - Replace
frontend-lead@example.comandbackend-lead@example.comwith your team leads’ addresses.
- In the trigger’s
- Open Workflows, click Import, paste the YAML, and click Import.
- Click Open workflow, and set these before you publish:
- On the trigger, pick your Jira connection under Account, and pick the Site.
- On every Jira step, pick your Jira connection and the Site.
- On every Slack step, pick your Slack connection and the channel.
How each step works
Section titled “How each step works”The trigger
Section titled “The trigger”The Jira New issue trigger runs once for each new issue. Narrow with JQL is project = APP AND issuetype = Bug, so only new bugs in that project start a run. KloudMate checks Jira for new issues every couple of minutes, so a run starts shortly after the bug is filed, not at the same moment.
The event carries the new issue’s key as trigger.event.key, with a few common fields, but not the description.
Read the bug
Section titled “Read the bug”A Jira Get Issue step reads the whole issue, with Issue key set to {{ trigger.event.key }}. The description is in steps.issue.output.fields.description.
Triage the bug
Section titled “Triage the bug”An AI Extract step reads the summary and the description, which its Source passes as one object:
Output fields asks for the component and the priority from fixed lists, and a one-sentence reason:
The description of each field tells the model what the options mean for your product, so edit them to match how your teams split the work.
Anyone who can file a bug writes the text the model reads, which is why the workflow uses AI Extract. Whatever the report says, component and priority can only come back as one of the listed options. See AI Extract.
Set the priority and comment
Section titled “Set the priority and comment”A Jira Update Issue step sets the priority, with Fields set to {"priority": {"name": "{{ steps.triage.output.priority }}"}}. The priority options are Jira’s default priority names. If your site uses others, use those in Output fields instead.
A Jira Add Comment step records the decision on the issue, so everyone who opens the bug can see why it was routed where it was:
Jira reads *text* in a comment as bold.
Which team?
Section titled “Which team?”A Route picks a path by steps.triage.output.component. The frontend path runs when it equals frontend, and the backend path when it equals backend. Otherwise runs for unknown.
Each team’s path has these steps:
- A Jira Find User step looks up the team lead by email.
- A Jira Assign Issue step assigns the bug to the lead, with Assignee set to
{{ steps.find_frontend_lead.output.users.0.accountId }}. Jira assigns issues by account ID, not by email, which is why the lookup comes first. - A Slack Post Message step posts the bug in the team’s channel, with a link to it.
Otherwise only posts the bug in the triage channel. It doesn’t assign it to anyone.
Keep Slack messages safe
Section titled “Keep Slack messages safe”The Slack messages include the bug’s summary, which the person who filed the bug wrote. Slack gives some text in a message a special meaning, so a summary that contains <!channel> would notify everyone in the channel. The messages escape &, <, and >, the characters Slack treats specially:
The summary then shows up as written, and mentions nobody.
Step 3: Test and publish
Section titled “Step 3: Test and publish”- Open the trigger’s Test tab and click Test trigger, then pick a recent bug as the sample.
- Test Read the bug and Triage the bug from their Test tabs. The triage output shows what the model decided, without changing anything in Jira.
- Click Test run to run every step for real on that bug. It changes the bug’s priority, comments on it, assigns it, and posts in Slack.
- Click Publish. The first publish also switches the workflow on.
From then on, each new bug in the project gets a run. To see what the workflow decided for a bug, open the run from Workflows → Runs.
Adapt the workflow
Section titled “Adapt the workflow”- Add a team. Add an option to
componentin Output fields, with a line about it in thedescription. Then add a Route path with a matching condition and the team’s three steps. - Keep a person in the loop. Remove Set the priority and the assign steps, and keep the comment. The team then sees the suggestion and decides for themselves.
- Triage other issue types. Change the trigger’s JQL, for example to
project = APP AND issuetype in (Bug, Task). - Label the bug instead of assigning it. Replace the assign steps with a Jira Update Issue step that sets
{"labels": ["team-frontend"]}, for teams that pull work from a board.