MS Teams#

This configuration adds a web service which can be triggered e.g. with an event. We create a Office 365 Connector card (MessageCard) that shows up in a MS Teams Chat.

Example MessageCard in MS Teams

We used the documentation 2 to “design” our card.


And again, we need a Webhook URL. Check the manual 1 how get get one. Keep the URL ready for later, it’s needed for the transport configuration of the requester.

Import and Configuration#

Open the Web Service Management in the from the Admin Overview and click on Add Web Service.

Import the predefined web service

Select MS Teams Notification and click on the button below to import the predefined web service.

Now the webhook URL needs to be added to the transport if the requester. Click on the name of the web service and configure the network transport of the Requester section:

The requester's transport configuration

Split the webhook URL in two parts, the 2nd part is everything after the last /.

Replace YOURHOOK_PART1 in the setting Endpoint with first part of the splitted webhook and YOURHOOK_PART2 with the second part. Both parts together must be equal to the generated webhook.

Execute the web service#

Now we need to add an event when the invoker should be executed. Click on the name of the predefined invoker Escalate.

Select the predefined invoker

The next step is to choose the wanted event, in our example NotificationEscalation and check the box for Asynchronous too. Click the + and Save and finish.

Configure the Event triger


The used XSLT for the outbound mapping contains some interesting parts:

 1<?xml version="1.0" encoding="UTF-8"?>
 2<xsl:transform version="1.0" xmlns:xsl="" xmlns:date="" extension-element-prefixes="date">
 3    <xsl:output method="xml" encoding="utf-8" indent="yes"/>
 4    <xsl:template match="RootElement">
 5        <xsl:copy>
 6            <themeColor>0076D7</themeColor>
 7            <Initialtype>MessageCard</Initialtype>
 8            <Initialcontext></Initialcontext>
 9            <summary>Ticket <xsl:value-of select="//Ticket/TicketNumber" /> is escalated</summary>
10            <sections>
11                <activityTitle>Ticket #<xsl:value-of select="//Ticket/TicketNumber" />&#160;is escalated</activityTitle>
12                <markdown>true</markdown>
13                <facts><Name>Owner</Name><Value><xsl:value-of select="//Ticket/OwnerData/UserFullname"/></Value></facts>
14                <facts><Name>State</Name><Value><xsl:value-of select="//Ticket/State"/></Value></facts>
15                <facts><Name>Type</Name><Value><xsl:value-of select="//Ticket/Type"/></Value></facts>
16            </sections>
17            <potentialAction>
18                <potentialActiontype>ViewAction</potentialActiontype>
19                <potentialActioncontext></potentialActioncontext>
20                <name>View ticket in Znuny</name>
21                <target>&lt;OTRS_CONFIG_HttpType&gt;://&lt;OTRS_CONFIG_FQDN&gt;/&lt;OTRS_CONFIG_ScriptAlias&gt;/;TicketID=<xsl:value-of select="//Ticket/TicketID" /></target>
22            </potentialAction>
23        </xsl:copy>
24    </xsl:template>
  • In line 21 we use system configuration setting to create the link to the ticket detail view.

Additional settings in the outbound mapping
  • The XML elements sections, target and potentialAction (line 10, 17, 21) are configured to be converted to an array with the setting Force array for tags.

  • Since the MessageCard JSON needs keys with an @ as prefix and we can’t use them in the XSLT mapping we use a little trick: we use our own elements and rename them after the mapping with the regular expresssions.

Links to external documentation