Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Sending Microsoft Teams Notifications to the Caller When an Incident Is Created in ServiceNow

IndlaA
Tera Contributor

 

Overview

This article explains how to send an automatic Microsoft Teams notification to the Caller whenever an Incident is created on their behalf in ServiceNow.
The notification will include:

  • Incident Number

  • Short Description

  • A clickable link

  • The link opens the Incident in Self-Service (ESS) View

  • The message is delivered directly to the caller’s Teams chat

This enhances end-user communication and ensures that callers instantly receive visibility into their submitted or delegated incidents.


1. Storing the Caller’s Microsoft Teams Chat ID

 

To send a Teams message, we need the Chat ID of the 1:1 conversation between your Teams App and the caller.

How to retrieve Chat ID (one time only)

  1. Go to Microsoft Graph Explorer:
    https://developer.microsoft.com/en-us/graph/graph-explorer

     2.Run:

               GET https://graph.microsoft.com/v1.0/me/chats

     
      3. Look for a chat with:

 

                "chatType": "oneOnOne"
      4. Copy the id value

                  Example:   19:525552f8-3cc4-4705-b101-95cea1d45675f_75d4ab02-1d0f-4051-9d9a-c0b677f0a621@unq.gbl.spaces

       5. Save it to the Caller’s user record in ServiceNow:

           Field → correlation_id
           Value → Chat ID


2. Required Permissions for Sending Teams Messages

 

Your Azure App used for integration must have these Microsoft Graph Delegated Permissions:

 

Permission Description
ChatMessage.SendAllows sending a chat message
Chat.ReadWriteAllows posting in 1:1 or group chats
User.ReadMandatory basic scope

 

If missing, you will receive:

 

         Missing scope permissions: ChatMessage.Send, Chat.ReadWrite

3. Creating the REST Message in ServiceNow

 

Endpoint

 

Headers

Name Value
AuthorizationBearer ${access_token}
Content-Typeapplication/json
 

4. Final Working JSON to Send to the Caller (ESS View Support)

 

 
IndlaA_0-1763129410582.png

 

Replace devXXXX with your instance name.


5. Business Rule Example: Send Teams Message to Caller

Trigger: After Insert on Incident table
Script:

 

IndlaA_1-1763129541800.png

 


6. What the Caller Sees in Teams

The user receives a message:


A new incident has been created on your behalf.
Incident Number: INC0012345
Short Description: Email access not working

🔗 Click here to view your Incident
(Loads in ESS View)


Conclusion

By integrating ServiceNow with Microsoft Teams, you can automatically notify callers when incidents are created for them. Using the encoded uri= technique ensures the record opens in Self-Service View, improving the user experience.

This approach can be extended to:

  • HR Cases

  • Service Catalog Requests

  • Approvals

  • Assignment Notifications

  • SLA Breach Alerts

0 REPLIES 0