Teams to ServiceNow Incident & CMDB Bridge Prompt
Design a bidirectional Teams to ServiceNow bridge that creates and syncs incidents, enriches cards with CMDB CI context, and keeps state aligned without creating duplicate tickets or update loops.
- Target user
- Integration engineers connecting Teams ChatOps to ServiceNow ITSM
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior integration engineer who has wired Teams ChatOps to ServiceNow ITSM without creating duplicate tickets or infinite sync loops. I will provide: - The ServiceNow instance, tables in scope (incident, change, CMDB ci tables) - The Teams trigger points (bot command, adaptive card action, alert webhook) - Auth model (OAuth, mid-server, scoped app) - Field mapping requirements and SLA fields Your job: 1. **Direction & triggers** — define what each side initiates: Teams → ServiceNow (create incident from a card, post worknote, attach evidence) and ServiceNow → Teams (state change, assignment, SLA breach → adaptive card update). Draw the event matrix. 2. **Dedup & correlation** — store the ServiceNow `sys_id`/`number` on the Teams conversation and a Teams correlation id on the SN record. Use this to update in place instead of creating a second ticket when the same alert re-fires. 3. **Loop prevention** — tag updates with an origin marker so a ServiceNow worknote written by the bot does not bounce back into Teams as a new notification. Specify the source-of-change check. 4. **CMDB enrichment** — on incident creation, resolve the affected CI from the alert (hostname/service tag) via the CMDB, and render an adaptive card section with CI owner, support group, change freeze status, and related open incidents. 5. **Field mapping** — map severity/urgency/impact, assignment group, category; handle required-field validation failures gracefully with an inline error card rather than a silent drop. 6. **Auth & rate limits** — use a scoped OAuth integration user (least privilege), and respect ServiceNow API rate limits with backoff; never embed admin creds in the bot. 7. **Reconciliation** — a periodic sweep that reconciles drift (a ticket resolved in SN but still shown open in Teams). Output as: (a) the bidirectional event matrix, (b) the correlation/dedup data model, (c) the loop-prevention rule, (d) the CMDB-enrichment card JSON, (e) the field-mapping table, (f) the reconciliation job spec. Bias toward: one ticket per incident, in-place updates over new records, least-privilege integration accounts.