ADO Work Item Priority Override Approval
Triggered when a work item's priority is changed to P1/Critical. Routes an Approvals request to the product owner to confirm the priority escalation is justified. On approval, adds a comment to the ADO work item with the approver's name and timestamp. On rejection, reverts the priority and notifies the requester via Teams and Outlook.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
FlowLibs - ADO Work Item Priority Override Approval is a scheduled Cloud Flow that monitors Azure DevOps for work items recently escalated to P1/Critical priority. For each detected escalation, it routes an Approvals request to the designated product owner. If approved, the flow adds a timestamped approval comment to the work item. If rejected, it reverts the priority to P2 and notifies stakeholders via Teams and Outlook.
Use Case
In fast-moving sprint teams, developers sometimes escalate work items to P1/Critical without proper justification. This flow ensures every critical priority change is reviewed and approved by the product owner, maintaining priority hygiene across the backlog. Rejected escalations are automatically reverted, reducing noise in triage meetings.
Flow Architecture
Check For Priority Changes
RecurrenceRecurrence trigger runs hourly.
Initialize Variables (parallel)
Initialize variableSix Initialize Variable actions run in parallel, each reading from a solution environment variable: varAdoOrganization (flowlibs_AdoOrganization), varAdoProject (flowlibs_AdoProject), varTeamsGroupId (flowlibs_TeamsGroupId), varTeamsChannelId (flowlibs_TeamsChannelId), varProductOwnerEmail (flowlibs_ProductOwnerEmail), varNotificationEmail (flowlibs_NotificationEmailAddress).
Query Recently Changed P1 Work Items
Azure DevOps - HttpRequestRuns a WIQL query filtering for Priority = 1 and ChangedDate within the last day.
Parse WIQL Results
Compose / Parse JSONExtracts work item IDs from the WIQL response.
For Each Work Item
Apply to eachFor each returned work item: get its full details via the ADO HttpRequest action, then evaluate the priority condition. Inner steps run per work item.
Get Work Item Details
Azure DevOps - HttpRequestGET the work item with $expand=all to retrieve all field values.
Check If Priority Is Critical
If conditionChecks whether Microsoft.VSTS.Common.Priority equals 1.
- Start Priority Override Approval — Approvals StartAndWaitForAnApproval (Basic) routes to the product owner with work item details and a direct link to ADO.
- — Nested condition on the approval outcome. On Approve: Add Approval Comment To Work Item via ADO HttpRequest POST with the approver name and UTC timestamp. On Reject: Revert Work Item Priority via ADO HttpRequest PATCH to priority 2, Post Rejection To Teams via PostMessageToConversation in the sprint channel, and Send Rejection Email via Outlook SendEmailV2 with a formatted HTML rejection notice and work item link.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_AdoOrganization | String | <your-org> | Azure DevOps organization slug used to build API URLs and ADO links. |
| flowlibs_AdoProject | String | FlowLibs | Azure DevOps project name that the WIQL query targets. |
| flowlibs_TeamsGroupId | String | <configure> | Group (Team) ID of the Microsoft Teams team that receives rejection messages. |
| flowlibs_TeamsChannelId | String | <configure> | Channel ID inside the Teams group where rejection messages are posted. |
| flowlibs_ProductOwnerEmail | String | po@yourcompany.com | Email address of the product owner who approves priority escalations. |
| flowlibs_NotificationEmailAddress | String | team@yourcompany.com | Email address (or distribution list) that receives the rejection notice when an escalation is denied. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Azure DevOps | shared_visualstudioteamservices | HttpRequest (WIQL query, work item GET/PATCH, comment POST) |
| Approvals | shared_approvals | StartAndWaitForAnApproval (Basic type) |
| Microsoft Teams | shared_teams | PostMessageToConversation (On rejection) |
| Office 365 Outlook | shared_office365 | SendEmailV2 (On rejection) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Change approval type
- Modify the approvalType parameter from Basic (first to respond) to BasicGroup (everyone must approve) for stricter governance.
- Add approval timeout
- Add a parallel branch with a Delay action and terminate if the approval isn't responded to within X days.
- Change revert priority
- Modify the PATCH body value from 2 (High) to 3 (Medium) or another priority level to control where rejected items land.
- Add more notification channels
- Duplicate the Teams action for additional channels, or add Slack / mobile push notifications alongside the Outlook email.
- Filter by area path
- Add AND [System.AreaPath] UNDER 'ProjectName\\TeamArea' to the WIQL query to scope the flow to specific teams.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01WIQL date filter
Scans the last 24 hours of work item changes.
EXPR.02Priority check
Compared to 1 in the If condition to detect P1/Critical items.
EXPR.03Approval outcome
Compared to "Approve" to branch between approved and rejected paths.
EXPR.04Responder name
Used in the approval comment added to the work item.
EXPR.05ADO work item link
Builds a direct deep link to the work item for the approval card and notifications.
EXPR.06UTC timestamp
Used in the approval comment to record when approval was granted.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.