-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post to Microsoft Teams is using MessageCard (Legacy) format instead of AdaptiveCard #1530
Comments
Instead of using the AdaptiveCard format I left it as MessageCard and was able to get the Teams notification to come through using Workflows with the new webhook URL. The trick in the workflow was to...
The problem I see with this approach, and one that I'm not sure AdaptiveCard would solve, is that it doesn't handle markdown properly. In the message body example above using |
@delphe valid point, I suppose using the AdaptiveCard format is not absolutely necessary depending on how you configure a PowerAutomate workflow |
@delphe actually i believe the AdaptiveCard format will handle markdown - https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format?tabs=adaptive-md%2Cdesktop%2Cconnector-html#format-cards-with-markdown |
I was able to just update the webhook url to migrate to the logic app url. Then, using Post As User, using this json: {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.4",
"type": "AdaptiveCard",
"fallbackText": "@{triggerBody()?['title']}",
"body": [
{
"type": "TextBlock",
"text": "@{triggerBody()?['text']}",
"wrap": true
}
]
} And |
Thanks @tbolon ! I went back to using "Post card in a chat or channel" and tried that JSON, which resolved my issue with using markdown. I played around with using
Although, the only acceptable "colors" found in adaptive-cards schema are: |
glad I found this today, thank you all for contributing. I don't like that it posts as "firstname lastname via workflows". I see there's a way to add a bot via copilot, but I don't appear to have a license to use copilot software. Any suggestions? |
I will certainly migrate out of using adaptive cards, as it seems they are extremely limited in number of chars, and my release messages are quite long. Because they only accept HTML, I have alread switched my changelog generator to output HTML instead of markdown. Now I will try to use the post message action. |
#1572 should cover this. |
Step template
Microsoft Teams - Post a message - 110a8b1e-4da4-498a-9209-ef8929c31168
Step version
24
Octopus version
2024.2.9274
Step template parameter inputs
What happened
The message does indeed post to the teams channel when use the soon to be deprecated Office 365 connectors - https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/. The successor which is to use Microsoft Teams workflows (Power Automate) - it appears that the messages should be in the AdaptiveCard format - https://learn.microsoft.com/en-us/connectors/teams/?tabs=text1#microsoft-teams-webhook.
Reproduction steps
Complete the necessary parameters and the webhook will use the MessageCard (legacy) format.
More Information
I believe some changes to the Powershell script can be made to adopt the AdaptiveCard format. I am happy to submit a PR as well.
The text was updated successfully, but these errors were encountered: