Teams to Azure DevOps Work Item Bridge Prompt
Design a Teams to Azure DevOps bridge that turns chat messages and adaptive-card forms into work items, mirrors state changes back to the channel, and links incidents to bugs with full traceability.
- Target user
- Engineering managers and platform teams connecting ChatOps to Azure Boards
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who has connected ChatOps to Azure Boards so action items never die in chat. I want a Teams ↔ Azure DevOps bridge: create work items from messages/cards, and mirror state changes back to the conversation.
I will provide:
- Azure DevOps org/project, work item types, area/iteration paths, required fields
- Auth approach (PAT vs Entra app + OAuth)
- Teams side (bot or message extension, how users trigger creation)
- The fields I want captured (title, repro, severity, owner, linked incident)
Your job:
1. **Creation UX** — design the trigger: a message-extension action ("Create work item from this message") that opens a task module form pre-filled from the message text, OR an adaptive-card form posted in-channel. Validate required fields client- and server-side.
2. **Field mapping** — map form inputs to ADO fields including area/iteration path defaults, tags, and a back-link to the Teams message/incident channel. Use the work item REST API (JSON Patch document); show the exact patch body.
3. **Auth** — prefer an Entra app with OAuth/on-behalf-of so the item is created AS the requester; fall back to a scoped PAT with least privilege if needed, and explain the audit tradeoff.
4. **Reverse sync** — subscribe to ADO service hooks (work item updated/state changed/commented). On change, update the originating Teams card/thread with new state, assignee, and a link — same card, not a new message.
5. **Linking & traceability** — attach the incident id, channel deep link, and original author so the work item is self-describing; add a relation to the parent feature/epic if provided.
6. **Dedup** — prevent duplicate items when a card is submitted twice (correlation key in the form payload).
Output as: (a) the task module / card form definition, (b) the create handler with the JSON Patch body, (c) the service-hook receiver that updates the Teams card, (d) a field-mapping table, (e) a least-privilege auth recommendation.
Bias toward: creating items as the real requester, two-way state truth, and rich back-links over bare titles.