Microsoft Teams Integration
Last updated
Last updated
Trunk allows you to create custom workflows to send customized messages to Microsoft Teams channels through webhooks.
This guide will walk you through sending Microsoft Teams messages using event-triggered webhooks. By the end of this tutorial, you'll receive Microsoft Teams messages for test status changes. This guide should take 10 minutes to complete.
Microsoft has two different concepts for accepting incoming webhooks. Connectors that are being deprecated and Workflows that are for newly created teams. This guide is for the newer Workflows. The workflow for configuring webhooks is similar, but you may see small differences. You can find more about the soon to be deprecated connectors in Microsoft's documentation.
Open the team in which you want to add the webhook and select the kebab menu (•••) from the upper-right corner.
Select Workflows from the dropdown menu.
Search for Post to a channel when a webhook request is received
, select the workflow, then click Next.
Configure the workflow's Microsoft Teams Team and Microsoft Teams Channel, then click Add workflow.
When the workflow is added correctly, you can copy the URL displayed, then click Done.
Trunk uses Svix to integrate with other services, such as Microsoft Teams messages through webhooks.
You can create a new endpoint by:
Login to Trunk Flaky Tests
From your profile on the top right, navigate to Settings
Under Organization > Webhooks, click Teams
Paste your Microsoft Teams Workflow URL from the previous step into Endpoint URL.
Review the transformation code automatically generated for Teams messages. You can customize this transformation at any time. Learn more about customizing transformations.
Create the new endpoint. You will be redirected to the endpoint configuration view.
Transformations are custom code snippets you can write to customize the Microsoft Teams messages created by the webhook. A working template transformation will be added automatically for your webhook, but you can further customize the behavior of this webhook.
In the endpoint configuration view, navigate to the Advanced tab. Under Transformation, toggle the Enabled switch.
Click Edit transformation to update your transformation code, and click Save to update the transformation.
You can test the transformation by selecting the test_case.status_changed
payload and clicking Run Test. This will test the transformation but not send a message. You will learn to send a test message in step 4.
Below is an example of a webhook transformation to format the messages as Actionable Messages. If you're having trouble adding a new webhook endpoint with Svix, please see the Adding Endpoint docs from Svix.
You can send test messages to your Microsoft Teams channels as you make updates. You can do this by:
In the endpoint configuration view, navigate to the Testing tab and select a Send event
Under Subscribed events, select test_case.status_changed
as the event type to send.
Click Send Example to test your webhook
You should now receive notifications in your Teams channel when a test's status changes. You can further modify your transformation script to customize your messages.
See the Trunk webhook event catalog
Want to chat with Trunk's engineers? Join us and 1500+ fellow engineers on Slack.
You can monitor the events and the webhook's delivery logs in the Overview tab of an endpoint configuration view.
You can see an overview of how many webhook deliveries have been attempted, how many are successful, how many are in-flight, and how many fail in the Attempt Delivery Status modal.
You can see a list of past delivery attempts in the Message Attempts modal. You can filter this list by Succeeded and Failed status, and you can click on each message to see the Message content, response code, and error message of each attempt. You can learn more about replaying messages and filtering logs in the Svix docs.