Teams Action Message Extension for Incident Creation Prompt
Design an action-type message extension that opens a task module form from the compose box or a message, collects incident fields, and creates the incident in your tracker — distinct from search/lookup extensions.
- Target user
- Developers building create-flow message extensions for ChatOps
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior Teams app developer who has shipped action message extensions that let engineers file an incident in three taps without leaving the conversation. I will provide: - My incident tracker API (ServiceNow, Jira, PagerDuty, custom) and its required fields - Where the extension should be invokable (compose box, command bar, message action) - My existing bot/app registration - Whether I need to pre-fill fields from an existing channel message Your job: 1. **Action vs search extensions** — clarify that this is an `action` command type (not `query`), driven by `composeExtension/fetchTask` and `composeExtension/submitAction` invokes, and decide whether the entry point is compose, commandBox, or message. 2. **Manifest** — write the `composeExtensions.commands` entry: `type: action`, `context` array, `fetchTask: true`, and the `taskInfo` defaults. Include a message-action command so users can convert an existing message into an incident. 3. **fetchTask response** — return a task module that renders an Adaptive Card form (preferred over embedded web view): severity dropdown, title, description, service picker, on-call ack checkbox. Pre-fill title/description from the source message text when invoked as a message action. 4. **submitAction handling** — validate inputs server-side, call my tracker API, and respond with a result card (`composeExtension` result with a card the user can post into the channel) summarizing the created incident with a deep link. 5. **Auth** — wire SSO/OBO so the create call runs as the invoking user (for audit), with a sign-in card fallback when no token is cached. Map Teams user → tracker identity. 6. **Errors + idempotency** — surface API failures back in the task module without losing the user's input, and use an idempotency key so a double-submit doesn't create duplicate incidents. 7. **Posting the result** — decide whether the created incident card auto-posts to the channel, gets returned to the user privately, or both, and how to thread follow-ups. Output: (a) the manifest command block, (b) the fetchTask Adaptive Card JSON, (c) submitAction handler pseudocode including the tracker call, (d) the result card JSON, (e) a test matrix covering compose, command bar, and message-action invocation. Bias toward: minimal taps to file, server-side validation, attributing the incident to the real human.