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.
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
| Variable | Schema Name | Type | Default | Purpose |
|---|---|---|---|---|
| GitHub Repo Owner | flowlibs_GitHubRepoOwner | String | (none) | GitHub user or org that owns the repo being watched |
| GitHub Repo Name | flowlibs_GitHubRepoName | String | (none) | Name of the GitHub repository |
| Teams Group ID | flowlibs_TeamsGroupId | String | (none) | Teams team ID hosting the routing channels |
| Teams Bug Channel ID | flowlibs_TeamsBugChannelId | String | (none) | Teams channel for bug notifications |
| Teams Security Channel ID | flowlibs_TeamsSecurityChannelId | String | (none) | Teams channel for security notifications (highest priority) |
| Teams Docs Channel ID | flowlibs_TeamsDocsChannelId | String | (none) | Teams channel for documentation notifications |
| Teams Triage Channel ID | flowlibs_TeamsTriageChannelId | String | (none) | Fallback channel for unlabeled issues |
Connectors & Connections
| Connector | API Name | Connection Format | Usage |
|---|---|---|---|
| GitHub | shared_github | raw GUID | IssueOpened trigger + GetIssueLabels |
| Microsoft Teams | shared_teams | shared-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