CloudEmail & Graph APIAutomated

Auto-Route Issue by Label

On issue open/labeled, reads the issue's labels and routes notifications: 'bug' → dev Teams channel, 'security' → security channel, 'docs' → docs channel, unlabeled → triage.

Members OnlySign in or create a free account to download this solution.

Overview

Watches a GitHub repository for newly opened issues, reads their labels, and posts a formatted notification to the appropriate Microsoft Teams channel based on label-driven routing rules. Keeps triage lean by surfacing bugs, security issues, and documentation gaps to the right specialist channels — and everything else goes to a generic triage channel so nothing is lost.

**State:** Stopped (Off)

Use Case

Engineering teams struggle with noisy GitHub notifications: "everything feeds" bury high-signal issues. This flow lets a GitHub admin wire up label-based triage once. Bugs land in dev channel; security findings route to security response; doc issues to documentation channel; unlabeled to triage.

**Priority order:** security > bug > docs > triage. Cross-labeled issues never hide a security concern behind a bug label.

Flow Architecture

Trigger: **When a new issue is opened** (GitHub IssueOpened, polls every 5 min, splitOn fanout).

1. Init 7 vars (repo owner, repo name, Teams group, 4 channel IDs)
2. **Get Issue Labels** (GitHub GetIssueLabels)
3. Select Label Names (Data Operations Select to flat array)
4. **Compose Route Key** (nested if: security → bug → docs → triage)
5. **Switch On Route** (3 cases + default)
   - security: Post to Security Channel (🛡️)
   - bug: Post to Bug Channel (🐛)
   - docs: Post to Docs Channel (📝)
   - default: Post to Triage Channel

Environment Variables

VariableSchema NameTypeDefaultPurpose
GitHub Repo Ownerflowlibs_GitHubRepoOwnerString(none)GitHub user or org that owns the repo being watched
GitHub Repo Nameflowlibs_GitHubRepoNameString(none)Name of the GitHub repository
Teams Group IDflowlibs_TeamsGroupIdString(none)Teams team ID hosting the routing channels
Teams Bug Channel IDflowlibs_TeamsBugChannelIdString(none)Teams channel for bug notifications
Teams Security Channel IDflowlibs_TeamsSecurityChannelIdString(none)Teams channel for security notifications (highest priority)
Teams Docs Channel IDflowlibs_TeamsDocsChannelIdString(none)Teams channel for documentation notifications
Teams Triage Channel IDflowlibs_TeamsTriageChannelIdString(none)Fallback channel for unlabeled issues

Connectors & Connections

ConnectorAPI NameConnection FormatUsage
GitHubshared_githubraw GUIDIssueOpened trigger + GetIssueLabels
Microsoft Teamsshared_teamsshared-teams-d6c7aabb-...PostMessageToConversation — routes to four channels

Customization Guide

1. Install solution; set 7 env vars; authorize connections; turn on.
2. **Add or modify routing labels** by editing Compose Route Key if your repo uses defect instead of bug. Extend Switch with new cases + env var + channel.
3. **Adjust priority** by re-ordering if() nesting.
4. **Change polling interval** in trigger recurrence.
5. **Replace message templates** per case independently.

Key Expressions

- @parameters('flowlibs_...') — Init vars (×7)
- @triggerOutputs()?['body/number'] — issue number
- @item()?['name'] — Select Label Names map
- @if(contains(body('Select_Label_Names'), 'security'), 'security', if(contains(body('Select_Label_Names'), 'bug'), 'bug', if(contains(body('Select_Label_Names'), 'docs'), 'docs', 'triage'))) — route key
- @{concat('https://github.com/', variables('varRepoOwner'), '/', variables('varRepoName'), '/issues/', triggerOutputs()?['body/number'])} — issue link