Integrate an Automation rule with Microsoft Teams
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
This procedure describes how to integrate an automation rule with a Microsoft (MS) Teams channel to show notifications about Jira issues.
If you want Jira to send messages to an MS Teams channel, you first need to integrate Microsoft Teams with Jira automation. This integration provides a webhook URL that automation uses to send messages to your MS Teams channels. This integration can be revoked at any time.
Create workflow in MS Teams
To set up a Microsoft Teams integration, you need to create a flow chain that will listen to Jira webhooks:
- Go to Microsoft Teams and find the channel where you want to send Jira notifications. Next to the channel name, select More options (...), then select Workflows.
Select More workflows, then Create from blank.
In the Search connectors and triggers field, enter Webhook.
Under Triggers, select the When a Teams webhook request is received trigger.
In the Who can trigger the flow dropdown, select Anyone.
Select New Step, search for Parse JSON, and then select this option under Actions.
In the Content field, enter
@{triggerBody()}
.- In the Schema field, add the following JSON Schema.
6. Select New Step, search for Card, and then select Post message in a chat or channel under Actions. Then:
In the Post in dropdown, select Channel.
In the Team and Channel dropdowns, select the team and channel where the notification should be posted.
7. In the Adaptive Card field, add the following JSON:
8. Verify that the step chain looks like on the screenshot, and then select Save.
9. Copy the webhook URL to the clipboard.
Add the webhook domain to the allowlist so that you can send data to it. Otherwise, the webhook could be blocked.
Paste webhook URL in Jira
The next steps will depend on the Jira automation version you’re using:
For a Jira automation version older than 9.0.0:
Go to your automation rule, then select the Send Microsoft Teams notification action.
Paste the webhook URL into the Webhook URL field.
For a Jira automation version newer than 9.0.0:
Create a new secret key by following these instructions and using the webhook URL obtained from the Microsoft Teams interface.
Go to your automation rule, then select the Send Microsoft Teams notification action.
From the Wehbook URL dropdown select the secret key created earlier.
All done! You’re now integrated with your Microsoft Teams channel.
Markdown support
Microsoft Team messages support basic markdown for rich formatting. The only limitations are:
Images
Inline HTML
HTML blocks
Custom nodes
If you're using characters such as * or # and you want them to appear as characters in your message content, you need to escape them; otherwise, they'll be performing a markdown function. You can escape the characters by surrounding them with backslashes, for example \#\
.
Example
Send a message to a Microsoft Teams channel when a bug is raised. The message body is using smart values formatted with markdown language using:
Bold
Italics
Link
When this rule is triggered, a message in Microsoft Teams looks like this:
Done! You should now be able to receive messages from Jira in Microsoft Teams.