Post Messages in Microsoft Teams channel using Webhooks

Post Messages in Microsoft Teams channel using Webhooks

This article will guide you through the process of posting messages when a request is created to a Microsoft Teams channel using Connectors and ServiceDesk Plus's webhooks.

 To begin with, we have to create a connector for the Microsoft Teams channel to which we need to post messages to. To do so,

  1. In Microsoft Teams, choose the required channel and click on the three dots next to the name. Once clicked, choose the option 'Connectors'.

 

  1. Inside the connectors dialog box, locate the option 'Incoming Webhooks' and click Add.

  1. Once added, click on the three dots next to the channel again and click on Connectors.

  1. Now, next to Incoming Webhooks, click on Configure. You'll be asked to provide a name for the Incoming Webhook. Provide a name of your choice and click Create. You can optionally change the picture of the Incoming Webhook too.

 

  1. Once created, an endpoint URL will be provided. Copy that URL and keep it somewhere stored as it'll be used further down this process. 

  1. We've successfully setup a connector for the Microsoft Teams channel and an endpoint URL has been generated too. The next step is to use these to post messages.

  1. To do so, in ServiceDesk Plus, head to Admin -> Developer Space -> Web-hooks and click +New under the Request module.

  1. Once you click +New, you'll be navigated to the web-hook configuration page.

  1. Fill in the Name and the Description fields as per your requirement. Choose the HTTP method as 'POST'.

  1. Under URL, paste the URL that was copied in step number 5. The next field to be filled is the Request Payload.

  1. In Request Payload, the message to be posted in the Microsoft Teams channel should be specified in the JSON format. For example, if the message should say "Hey, a new Request has been created.", then the Request Payload will be :

{

"text":"Hey, a new request has been created."

}

     

  1. You can include dynamic content inside the message too. For instance, if you want the message to include the Request ID, you can make use of the dollar ($) variable to customise the message. Inside "text", type $ and you'll be provided with a list of the request's parameters that can be included in the message. Choose Request ID in this case.

 

  1. Once all the details have been filled, click on Save. Now the custom trigger to execute this web-hook to post message should be configured.

  1. To do so, head to Admin - > Automation - > Custom Triggers.

  2. Under the Request module, create a Trigger group if not created one already and then choose +Add Trigger. Now heading to the configuration,

  1. Provide the Trigger name as per your requirement. Under 'Execute on actions' field, in this case, we'll be choosing the value 'created' to post messages in the channel when a request is created.

  1. In the fields 'Execute during', 'Cascade execution' and 'Condition', configure the details as per your requirement.

  1. Under Actions, in the drop-down, select Webhook and then choose the web-hook that we just created to post messages.

  1. Once everything has been configured, choose Save.

  1. Everything has been successfully configured now to post messages to the Microsoft Teams channel.

From now, whenever a Request gets created, a message will be posted in the configured Microsoft Teams channel as specified.

 Note :

You can also include formatting options in the message content. The following formatting options are supported by Microsoft :

  1. Bold Text : **bold text**

  2. Italic Text : _italic text_

  3. Strikethrough Text : ~~strikethrough text~~

  4. Bold and Italic Text : **_bold and italic text_**

  5. Line breaks :

Important Note :
The connector's endpoint URL that we copied in step number 5 is to be kept       confidential as anyone with that URL will be able to post messages in that channel.

                  New to ADSelfService Plus?

                    • Related Articles

                    • Integrating MS teams with SDP MSP using Webhooks

                      PURPOSE: When a request is created under SDP MSP, a message is posted in the Microsoft Teams channel associated with the Account of the request. TESTED IN BUILDS: 14500, 14503 and 14504 PROCEDURE: STEP 1: Creating a Connector: >> To start, create a ...
                    • Integrating MS teams with SDP MSP using Webhooks

                      Overview: ServiceDesk Plus MSP seamlessly integrates with MS Teams to create a collaboration between the apps whenever any incidents takes place. This integration automatically posts updates about new requests from ServiceDesk Plus MSP to the ...
                    • Microsoft Teams Custom Widget For ServiceDesk Plus On Premises

                      Microsoft Teams Custom Widget for ServiceDesk Plus On-Premises Overview: The Microsoft Teams widget enables technicians to create and schedule meetings directly from within ServiceDesk Plus. Setting up Azure app registration: Head to the Azure portal ...
                    • Mail Fetching - The description of the Microsoft Teams invitation email is fetched in the iCalendar format

                      Issue The description of the Microsoft Teams invitation email will be in the "text/calendar" type, so it will be fetched in the iCalendar format. The fetched content will be as follows, BEGIN:VCALENDAR METHOD:REQUEST PRODID:Microsoft Exchange Server ...
                    • How to Export SSL certificate using MMC?

                      When an SSL certificate is already installed on a Windows server, you may want to reinstall it on ServiceDesk Plus server. This may be required when you have a Wildcard or a Multi-domain certificate, and the subdomains or different domains are hosted ...