[Bug] Microsoft Teams Notification integration does not work
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Microsoft Teams integration in GitLab sends an invalid payload in the Adaptive Card, causing the Teams webhook workflow to fail. The payload contains an extra wrapper around the actual AdaptiveCard, making it invalid according to Adaptive Card Designer.
Steps to reproduce
- Set up Microsoft Teams integration in GitLab as per the official documentation: https://docs.gitlab.com/user/project/integrations/microsoft_teams/
- Trigger an event that sends a Teams notification (e.g., issue created).
- Observe the failure in the webhook delivery.
- Copy the payload and paste it into https://adaptivecards.io/designer/.
- Validate the payload – it will be marked as invalid.
Example Project
Cannot share a public project due to confidentiality, but reproducible using any project with Teams integration enabled.
What is the current bug behavior?
GitLab sends a payload wrapped in:
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
...
}
}
This structure is not accepted by Microsoft Teams for Adaptive Cards and fails validation in the Adaptive Card Designer.
What is the expected correct behavior?
Teams expects just the AdaptiveCard object directly, e.g.:
{
"type": "AdaptiveCard",
"msteams": {
"width": "Full"
},
"version": "1.0",
"body": [...]
}
Relevant logs and/or screenshots
Invalid payload being sent (as captured):
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"msteams": { "width": "Full" },
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Issue opened by John Doe",
"weight": "Bolder",
"size": "Medium"
},
...
]
}
}
Correct payload that passes validation:
{
"type": "AdaptiveCard",
"msteams": { "width": "Full" },
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "my / repo",
"weight": "Bolder",
"size": "Medium"
},
...
]
}
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
Results of GitLab application Check
Expand for output related to the GitLab application check
Possible fixes
Ensure that the payload sent to Microsoft Teams webhook is just the AdaptiveCard object without any additional wrapping in contentType and content.
Relevant documentation reference: https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-reference#adaptive-cards
Patch release information for backports
N/A
High-severity bug remediation
N/A