teams integration inbound

archie5
Tera Guru

We have a requirement that when additional comments on Incident is added, the caller should get a teams message, and once caller replies to that message, the related incident should be updated as well. I am set on outbound, need help on steps to configure inbound. 

1. What is required on teams side as far as configuration is concerned (set up api?, webhook?)?

2. Within ServiceNow, we can user scripted rest api. Is there any other better way to catch that response from teams to update the ticket?

3. Will teams need to set up adaptive card etc to enable response (how will user respond to incidents if 3 were updated at the same time)?

Thank you so much!

 

1 ACCEPTED SOLUTION

Tarun Rekandar
Giga Guru

Hi @archie5,

 

The outbound integration is already in place. Below are the options and considerations for implementing inbound communication.

1. Understanding the Teams Integration

An Incoming Webhook is designed to receive HTTP requests and post messages or Adaptive Cards into Teams. It does not independently listen for normal user replies.

However, there are two ways to handle responses:

  • Power Automate Workflows: Use the Microsoft Teams action Post an adaptive card and wait for a response. The flow pauses until the user submits the card, then processes the response.

  • Microsoft Teams Bot: A bot can receive user interactions through its messaging endpoint and forward the submitted response to ServiceNow.

Therefore, a custom Azure bot is not mandatory. Power Automate may be sufficient for this requirement.

2. Implementation Options

A. Power Automate (Recommended for a Low-Code Approach)

This is a suitable approach if the requirement is limited to sending incident updates and collecting caller responses.

  1. Create a Power Automate flow triggered by an HTTP request from ServiceNow.

  2. Receive the incident details, including incident number, sys_id, caller email and comment.

  3. Use the Microsoft Teams action Post an adaptive card and wait for a response to send the card to the caller.

  4. Collect the caller's response when they submit the card.

  5. Use the ServiceNow connector or an authenticated HTTP request to update the corresponding Incident record.

  6. Add a condition to prevent integration-generated updates from triggering the outbound notification again.

Advantages: No custom Azure bot development is required. Power Automate handles the card response and flow continuation.

Considerations: Check connector availability, licensing, permissions, flow ownership and the supported Teams chat configuration.

B. Azure Bot Service + Middleware (Custom Approach)

If more control over conversations, message handling and multiple interactions is required, a custom Teams bot can be implemented.

Teams/Azure requirements:

  • Register a bot using Azure Bot Service and obtain the required application credentials.

  • Configure an HTTPS messaging endpoint to receive Bot Framework activities.

  • Enable the Microsoft Teams channel.

  • Create and publish a Teams app manifest that references the bot.

  • Configure the appropriate app scope and obtain tenant/user identification.

  • Map the ServiceNow caller to their Microsoft Entra ID.

  • Store the conversation reference and required conversation details for proactive messaging.

Important: For proactive one-to-one messaging using aadObjectId, the bot must be installed in the user's personal scope. Otherwise, Teams can return a 403 error. The required information includes the tenant ID, user identification and conversation/service URL.

Middleware responsibilities:

An Azure Function or Logic App can act as middleware between Teams and ServiceNow.

  1. Receive the user's response through the bot.

  2. Validate and process the incoming activity.

  3. Extract the incident sys_id and submitted response.

  4. Authenticate with ServiceNow.

  5. Update the Incident through the Table API or a Scripted REST API.

Use OAuth or another approved authentication method rather than exposing credentials in the integration.

C. ServiceNow Virtual Agent + Microsoft Teams

ServiceNow provides a native integration between Virtual Agent and Microsoft Teams.

Requirements include:

  • Conversational Integration with Microsoft Teams plugin (sn_va_teams).

  • Virtual Agent functionality and the required licensing/entitlements.

  • Microsoft Teams integration configuration.

  • Appropriate user authentication and account mapping.

ServiceNow also supports integration using a self-configured bot.

Important: Virtual Agent provides a Teams conversational channel. However, confirm whether the required custom incident-comment workflow can be implemented using the available Virtual Agent capabilities. It should not be assumed that enabling the integration automatically synchronizes arbitrary Teams replies with Incident comments.

Evaluate this option if Virtual Agent is already available in the organization.

D. ServiceNow Scripted REST API

A Scripted REST API can be created to accept the caller's response and update the Incident record.

For example:

  • Receive the incident sys_id and comment.

  • Validate the request and the user's authorization.

  • Update the Incident's Additional Comments field.

  • Return an appropriate response.

The Scripted REST API is the ServiceNow endpoint, not a Teams message listener. A bot or Power Automate flow must receive the Teams interaction and call this API.

3. Handling Multiple Incidents Using Adaptive Cards

Adaptive Cards are useful when multiple Incidents are being updated simultaneously.

For example, if a caller has three open Incidents, a generic response such as "Yes, that works" may not clearly identify which Incident the caller is referring to.

A better approach is to send a separate Adaptive Card for each Incident.

Each card should contain:

  • Incident number.

  • Latest Additional Comment.

  • A multiline text input for the caller's response.

  • A Submit button.

  • Hidden incident identification data, such as the sys_id.

Sample Adaptive Card:

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.4",
  "body": [
    {
      "type": "TextBlock",
      "weight": "Bolder",
      "text": "INC0012345 - New update"
    },
    {
      "type": "TextBlock",
      "wrap": true,
      "text": "<comment text from ServiceNow>"
    },
    {
      "type": "Input.Text",
      "id": "reply",
      "isMultiline": true,
      "placeholder": "Type your reply"
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Send reply",
      "data": {
        "incSysId": "<sys_id>",
        "incNumber": "INC0012345"
      }
    }
  ]
}

The receiving bot or workflow must validate the incident identifier and ensure that the response belongs to the correct caller and Incident.

Note: With a custom bot, Action.Submit delivers the submitted data to the bot. With Power Automate, the wait-for-response action captures the card submission and resumes the flow. These are different implementation paths.

After successful submission, update the card or message to indicate that the response has been received and prevent duplicate processing.

Alternative without Adaptive Cards: Include the Incident number in the Teams message and ask the caller to include it in their reply. The integration must then identify and validate the Incident before updating it. This approach is less reliable.

4. Suggested End-to-End Flow

  1. A ServiceNow Business Rule or suitable event-driven mechanism detects a change to Additional Comments.

  2. ServiceNow sends the caller's details, Incident number, sys_id and comment to the Power Automate flow or middleware.

  3. The flow/bot identifies the caller and sends an Adaptive Card to the appropriate Teams conversation.

  4. The caller enters a response and submits the card.

  5. Power Automate or the bot receives the response and calls the ServiceNow API.

  6. ServiceNow validates the request and updates the Incident's Additional Comments field.

  7. Implement a loop-prevention mechanism so that integration-generated updates do not trigger another outbound notification.

5. Important Decisions Before Implementation

  • Response identity: Should the reply be recorded under the integration user, with the original caller identified in the comment, or is a supported user-attribution mechanism required?

  • Teams app permissions: Does the organization allow custom Teams apps and the required permissions?

  • Licensing: Are Power Automate premium capabilities, ServiceNow integration entitlements or Virtual Agent licensing available?

  • Multiple incidents: Should each Incident have its own Adaptive Card and response workflow?

  • Security: How will caller identity, Incident access and incoming requests be validated?

  • Duplicate prevention: How will repeated card submissions and integration-generated updates be handled?

6. Recommendation

For this requirement, I would evaluate the solutions in the following order:

  1. Power Automate: Start here. The Teams action Post an adaptive card and wait for a response can handle the response without developing a custom bot.

  2. ServiceNow Virtual Agent: Evaluate the native Teams integration if the organization already has the required licensing and wants to use ServiceNow's conversational capabilities.

  3. Azure Bot + Middleware: Choose this when custom conversation handling, greater control or more complex interactions are required.

A Scripted REST API can serve as the ServiceNow endpoint in either the Power Automate or custom-bot architecture.

7. Official Documentation

Microsoft Teams

ServiceNow

 

Accept the solution if it assisted you with your question & Mark this response as Helpful.

 

Regards,
Tarun

View solution in original post

1 REPLY 1

Tarun Rekandar
Giga Guru

Hi @archie5,

 

The outbound integration is already in place. Below are the options and considerations for implementing inbound communication.

1. Understanding the Teams Integration

An Incoming Webhook is designed to receive HTTP requests and post messages or Adaptive Cards into Teams. It does not independently listen for normal user replies.

However, there are two ways to handle responses:

  • Power Automate Workflows: Use the Microsoft Teams action Post an adaptive card and wait for a response. The flow pauses until the user submits the card, then processes the response.

  • Microsoft Teams Bot: A bot can receive user interactions through its messaging endpoint and forward the submitted response to ServiceNow.

Therefore, a custom Azure bot is not mandatory. Power Automate may be sufficient for this requirement.

2. Implementation Options

A. Power Automate (Recommended for a Low-Code Approach)

This is a suitable approach if the requirement is limited to sending incident updates and collecting caller responses.

  1. Create a Power Automate flow triggered by an HTTP request from ServiceNow.

  2. Receive the incident details, including incident number, sys_id, caller email and comment.

  3. Use the Microsoft Teams action Post an adaptive card and wait for a response to send the card to the caller.

  4. Collect the caller's response when they submit the card.

  5. Use the ServiceNow connector or an authenticated HTTP request to update the corresponding Incident record.

  6. Add a condition to prevent integration-generated updates from triggering the outbound notification again.

Advantages: No custom Azure bot development is required. Power Automate handles the card response and flow continuation.

Considerations: Check connector availability, licensing, permissions, flow ownership and the supported Teams chat configuration.

B. Azure Bot Service + Middleware (Custom Approach)

If more control over conversations, message handling and multiple interactions is required, a custom Teams bot can be implemented.

Teams/Azure requirements:

  • Register a bot using Azure Bot Service and obtain the required application credentials.

  • Configure an HTTPS messaging endpoint to receive Bot Framework activities.

  • Enable the Microsoft Teams channel.

  • Create and publish a Teams app manifest that references the bot.

  • Configure the appropriate app scope and obtain tenant/user identification.

  • Map the ServiceNow caller to their Microsoft Entra ID.

  • Store the conversation reference and required conversation details for proactive messaging.

Important: For proactive one-to-one messaging using aadObjectId, the bot must be installed in the user's personal scope. Otherwise, Teams can return a 403 error. The required information includes the tenant ID, user identification and conversation/service URL.

Middleware responsibilities:

An Azure Function or Logic App can act as middleware between Teams and ServiceNow.

  1. Receive the user's response through the bot.

  2. Validate and process the incoming activity.

  3. Extract the incident sys_id and submitted response.

  4. Authenticate with ServiceNow.

  5. Update the Incident through the Table API or a Scripted REST API.

Use OAuth or another approved authentication method rather than exposing credentials in the integration.

C. ServiceNow Virtual Agent + Microsoft Teams

ServiceNow provides a native integration between Virtual Agent and Microsoft Teams.

Requirements include:

  • Conversational Integration with Microsoft Teams plugin (sn_va_teams).

  • Virtual Agent functionality and the required licensing/entitlements.

  • Microsoft Teams integration configuration.

  • Appropriate user authentication and account mapping.

ServiceNow also supports integration using a self-configured bot.

Important: Virtual Agent provides a Teams conversational channel. However, confirm whether the required custom incident-comment workflow can be implemented using the available Virtual Agent capabilities. It should not be assumed that enabling the integration automatically synchronizes arbitrary Teams replies with Incident comments.

Evaluate this option if Virtual Agent is already available in the organization.

D. ServiceNow Scripted REST API

A Scripted REST API can be created to accept the caller's response and update the Incident record.

For example:

  • Receive the incident sys_id and comment.

  • Validate the request and the user's authorization.

  • Update the Incident's Additional Comments field.

  • Return an appropriate response.

The Scripted REST API is the ServiceNow endpoint, not a Teams message listener. A bot or Power Automate flow must receive the Teams interaction and call this API.

3. Handling Multiple Incidents Using Adaptive Cards

Adaptive Cards are useful when multiple Incidents are being updated simultaneously.

For example, if a caller has three open Incidents, a generic response such as "Yes, that works" may not clearly identify which Incident the caller is referring to.

A better approach is to send a separate Adaptive Card for each Incident.

Each card should contain:

  • Incident number.

  • Latest Additional Comment.

  • A multiline text input for the caller's response.

  • A Submit button.

  • Hidden incident identification data, such as the sys_id.

Sample Adaptive Card:

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.4",
  "body": [
    {
      "type": "TextBlock",
      "weight": "Bolder",
      "text": "INC0012345 - New update"
    },
    {
      "type": "TextBlock",
      "wrap": true,
      "text": "<comment text from ServiceNow>"
    },
    {
      "type": "Input.Text",
      "id": "reply",
      "isMultiline": true,
      "placeholder": "Type your reply"
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Send reply",
      "data": {
        "incSysId": "<sys_id>",
        "incNumber": "INC0012345"
      }
    }
  ]
}

The receiving bot or workflow must validate the incident identifier and ensure that the response belongs to the correct caller and Incident.

Note: With a custom bot, Action.Submit delivers the submitted data to the bot. With Power Automate, the wait-for-response action captures the card submission and resumes the flow. These are different implementation paths.

After successful submission, update the card or message to indicate that the response has been received and prevent duplicate processing.

Alternative without Adaptive Cards: Include the Incident number in the Teams message and ask the caller to include it in their reply. The integration must then identify and validate the Incident before updating it. This approach is less reliable.

4. Suggested End-to-End Flow

  1. A ServiceNow Business Rule or suitable event-driven mechanism detects a change to Additional Comments.

  2. ServiceNow sends the caller's details, Incident number, sys_id and comment to the Power Automate flow or middleware.

  3. The flow/bot identifies the caller and sends an Adaptive Card to the appropriate Teams conversation.

  4. The caller enters a response and submits the card.

  5. Power Automate or the bot receives the response and calls the ServiceNow API.

  6. ServiceNow validates the request and updates the Incident's Additional Comments field.

  7. Implement a loop-prevention mechanism so that integration-generated updates do not trigger another outbound notification.

5. Important Decisions Before Implementation

  • Response identity: Should the reply be recorded under the integration user, with the original caller identified in the comment, or is a supported user-attribution mechanism required?

  • Teams app permissions: Does the organization allow custom Teams apps and the required permissions?

  • Licensing: Are Power Automate premium capabilities, ServiceNow integration entitlements or Virtual Agent licensing available?

  • Multiple incidents: Should each Incident have its own Adaptive Card and response workflow?

  • Security: How will caller identity, Incident access and incoming requests be validated?

  • Duplicate prevention: How will repeated card submissions and integration-generated updates be handled?

6. Recommendation

For this requirement, I would evaluate the solutions in the following order:

  1. Power Automate: Start here. The Teams action Post an adaptive card and wait for a response can handle the response without developing a custom bot.

  2. ServiceNow Virtual Agent: Evaluate the native Teams integration if the organization already has the required licensing and wants to use ServiceNow's conversational capabilities.

  3. Azure Bot + Middleware: Choose this when custom conversation handling, greater control or more complex interactions are required.

A Scripted REST API can serve as the ServiceNow endpoint in either the Power Automate or custom-bot architecture.

7. Official Documentation

Microsoft Teams

ServiceNow

 

Accept the solution if it assisted you with your question & Mark this response as Helpful.

 

Regards,
Tarun