Bitbucket Issue to Dataverse Project Sync
When a Bitbucket issue is created or updated, the flow syncs it to a Dataverse project/work table, maps state and priority, and notifies the assignee in Teams; status changes in Dataverse write back to the Bitbucket issue. Lets non-developers track engineering work in Power Platform apps while devs stay in Bitbucket.
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 solution keeps Bitbucket issues and a Dataverse mirror table in sync both ways, so project managers and stakeholders can track engineering work from Power Platform apps while developers stay in Bitbucket.
- Inbound (Bitbucket → Dataverse): when an issue is created or updated, the flow upserts a mirror row, maps the Bitbucket state to a Dataverse state label, and notifies the team in Teams. - Outbound (Dataverse → Bitbucket): when the mirror row's state changes in a Power App, the flow writes the new state back to the Bitbucket issue.
A source-flag loop guard (plus a trigger column filter) prevents the two directions from echoing each other into an infinite loop. A shared correlation id is stamped on every row for cross-system tracing.
> Built API-first (Dataverse workflow-table clientdata). All three flows ship Off and pass Flow Checker 0 errors / 0 warnings. Going live requires only connection authorization + environment-variable values (no logic changes).
Use Case
A team wants Bitbucket issues visible and updatable from Power Platform apps and dashboards, with status kept consistent on both sides. Devs continue triaging in Bitbucket; PMs adjust status in a model-driven/canvas app over the Dataverse table, and both views stay authoritative.
Flow Architecture
When A Bitbucket Issue Is Created
Bitbucket CreateHookIssueCreated (webhook)New-issue event; payload carries the full issue object. A parallel Flow 2 uses CreateHookIssueUpdated for edits.
Initialize guard variables
Initialize VariableMint a correlationId (guid()) and set a constant source tag Bitbucket written on every inbound upsert (loop guard).
Compose Issue Id / Mapped State
ComposeBitbucket issue id as a string (cross-system key) and map Bitbucket state → Dataverse state label via the JSON state-map env var.
Upsert mirror row
Dataverse ListRecords + Condition + CreateRecord/UpdateRecordLook up a mirror row by issue id; if it exists update it (re-stamp source=Bitbucket), else create a new row stamping source + correlation id.
Notify Assignee Teams
Teams PostMessageToConversationChannel alert naming the assignee.
Dataverse Status Write-Back (Flow 3)
Dataverse SubscribeWebhookTrigger (Update, filter flowlibs_state) + HTTP PUT + UpdateRecord + TeamsWhen a PM changes State in an app and the loop guard confirms the change did not originate from Bitbucket, map Dataverse state → Bitbucket state, PUT the new state back to the Bitbucket issue (no connector op exists), re-stamp source=Bitbucket + last-synced, and confirm in Teams.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_BitbucketWorkspace | String | your-workspace | Bitbucket workspace slug (trigger + write-back URL) |
| flowlibs_BitbucketRepoSlug | String | REPLACE_WITH_REPO_SLUG | Bitbucket repository slug |
| flowlibs_BitbucketApiBaseUrl | String | https://api.bitbucket.org/2.0 | Bitbucket REST base URL (write-back) |
| flowlibs_BitbucketAccessToken | String | REPLACE_WITH_BITBUCKET_ACCESS_TOKEN | Bearer token for the write-back HTTP call |
| flowlibs_TeamsGroupId | String | REPLACE_WITH_TEAMS_GROUP_ID | Teams team (group) id for notifications |
| flowlibs_TeamsChannelId | String | REPLACE_WITH_TEAMS_CHANNEL_ID | Teams channel id for notifications |
| flowlibs_BitbucketStateMap | String | {"new":"New","open":"Active","resolved":"Resolved","on hold":"On Hold","closed":"Closed","duplicate":"Cancelled","invalid":"Cancelled","wontfix":"Cancelled"} | Bitbucket state → Dataverse state label |
| flowlibs_BitbucketStateMapReverse | String | {"New":"new","Active":"open","Resolved":"resolved","On Hold":"on hold","Closed":"closed","Cancelled":"wontfix"} | Dataverse state → Bitbucket state (write-back) |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Bitbucket | shared_bitbucket | CreateHookIssueCreated CreateHookIssueUpdated |
| Microsoft Dataverse | shared_commondataserviceforapps | SubscribeWebhookTrigger ListRecords CreateRecord UpdateRecord |
| Microsoft Teams | shared_teams | PostMessageToConversation |
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.
- Comments sync
- Add a CreateIssueComment (or Bitbucket REST POST .../issues/{id}/comments) on the Dataverse side and a comment trigger inbound to mirror discussion both ways.
- Field mapping
- Extend the table and the item field map to carry components, labels, milestones, or kind.
- Bulk backfill
- Add a one-time Recurrence flow that pages existing issues via Bitbucket REST and seeds the mirror table.
- State map
- Edit flowlibs_BitbucketStateMap / …Reverse to match your Dataverse choice labels (no logic change).
- Assignee DM
- Swap the channel post for a per-assignee Teams chat or an Outlook email.
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.01Issue id (key)
Bitbucket issue id as the cross-system key.
EXPR.02Map state inbound
Maps Bitbucket state to a Dataverse state label.
EXPR.03Upsert branch
Update when a mirror row already exists, else create.
EXPR.04Loop guard (write-back)
Proceed with write-back only when the change did not originate from Bitbucket.
EXPR.05Write-back URL
Bitbucket issue endpoint for the state write-back.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.