PR Detail Sync to Planner
When a Planner task description contains a GitHub PR URL, fetches PR details (state, reviewers, check status) on a schedule and appends them to the task description so PMs track PR progress inside Planner.
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
This demo flow bridges GitHub and Microsoft Planner so project managers can see live pull request status inside their Planner board without leaving the tool. Once a day at 9:00 AM Eastern, the flow scans every task in a configured plan, looks for a GitHub PR URL in the task description, fetches the PR's current state from GitHub, and appends a status block (marked with an HTML comment sentinel) to the Planner task description. Subsequent runs update the block in place rather than stacking duplicates.
Use Case
Project managers live in Planner but engineers live in GitHub. When a PM asks "is this PR merged yet?" they shouldn't have to chase down a developer — the information should be in the card. This flow gives PMs a read-only view of PR health directly in the Planner task description: title, state (open/closed/merged), author, mergeable status, and last-update timestamp.
The flow is ideal for teams that:
- Mixed PM + engineering teams using Planner and GitHub.
- PMs who don't want to context-switch out of Planner to check PR status.
- Want PR status copied passively — no Planner workflow changes for engineers.
- Sentinel-based update so re-runs replace the block in place.
Flow Architecture
Recurrence_Daily_9AM
RecurrenceDaily 09:00 America/New_York.
Init 5 variables
InitializeVariablevarPlannerGroupId, varPlannerPlanId, varSyncMarker, varMatchTokenRepo='github.com/', varMatchTokenPull='/pull/'.
List_Plan_Tasks
Planner ListTasks_V3Returns every task in the plan (groupId + planId).
Apply_To_Each_Task / Check_If_Contains_PR_URL
Foreach + IfPer-task: Get_Task_Details (description lives there), then check whether it contains both `github.com/` and `/pull/`.
- Extract_PR_URL_Path / Normalize_PR_URL_Token / Split_PR_Segments — Substring after github.com/, split on whitespace+newline, then split on `/` → [owner, repo, 'pull', number, ...].
- Get_PR_Details — GitHub GetPullRequest with parsed owner/repo/number.
- Compose_PR_Status_Block — Builds the status text prefixed with the sync marker.
- Update_Task_With_PR_Status — Planner UpdateTaskDetails_V2 with the new description body.
Empty branch — task description is left untouched.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_PlannerGroupID | String | — | Microsoft 365 Group ID hosting the Planner plan. |
| flowlibs_PlannerPlanID | String | — | Planner Plan ID to scan. |
| flowlibs_PRSyncMarker | String | <!-- FlowLibs PR Sync --> | HTML comment sentinel placed before every auto-generated block. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Planner | shared_planner | ListTasks_V3 GetTaskDetails_V2 UpdateTaskDetails_V2 |
| GitHub | shared_github | GetPullRequest |
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.
- Match different Git hosts
- Change Init_varMatchTokenRepo to gitlab.com/ or dev.azure.com/ and swap the GitHub connector for the equivalent host's REST step.
- Include check/review status
- Add a GetChecksForRef call after Get_PR_Details and append to the status block.
- Filter to a label
- Add a Condition after Get_PR_Details that only updates when the PR has a tracked label.
- Run faster
- Switch the trigger to Hour or Minute. Watch GitHub rate limits (5000/hr with PAT, 60/hr unauthenticated).
- Handle private repos
- Use a PAT with repo scope. Store the token in a Dataverse Secret env var if you need rotation.
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.01Detect a PR URL in a description
Used in the per-task If condition.
EXPR.02Extract path after github.com/
First step of URL parsing.
EXPR.03Isolate the URL from surrounding prose
Splits on space then newline.
EXPR.04Coalesce null descriptions
Defends against null Planner descriptions.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.