question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft Teams - Invalid Message Formatting

See original GitHub issue

Describe the bug

Getting incorrect formatted message using MS Teams plugin. Text looks like escaped version with special characters like \n. For example: screes_actual

To Reproduce

Enable microsoft-teams plugin and execute auto shipit

Expected behavior

Message in MS Teams channel looks closed to formatted version from generated CHANGELOG.md. E.g. there are URLs, multiline formatting and basic emoji icons.

screen_expected

Screenshots

screes_actual

Environment information:

Linux, sh
auto v10.29.3
git 2.20.1

Additional context

Message in MS Teams channel looks like escaped/serialized markdown version. I performed two tests:

  1. Copy message from MS Teams channel and resend it via Postman using MS Teams Web hook URL. As result got well formatted text (more-less, because URLs links was missed)
  2. I copied text from generated CHANGELOG.md file, perform JSON string escaping and send it it via Postman using MS Teams Web hook URL. As result got well formatted text (only few icons were missed, but this is MS Teams related issue).

Based on this, I conclude that MS Teams API works fine but issue is with formatting on sender side.

For example what I did manually and hat works fine: source text from CHANGELOG.md:

:tada: This release contains work from a new contributor! :tada:

Thank you, DevName1 ([@DEV001](https://git.blahblah.com/DEV001)), for all your work!

#### 🐛 Bug Fix

- Hotfix([PROJ-1234](https://jira.blahblah.com/browse/PROJ-1234): ): use different step size for price and power filter … [#678](https://git.blahblah.com/some/repo/pull/678) ([@DEV001](https://git.blahblah.com/DEV001))

#### Authors: 1

- DevName1 ([@DEV001](https://git.blahblah.com/DEV001))

---

escaped string:

:tada: This release contains work from a new contributor! :tada:\n\nThank you, DevName1 ([@DEV001](https://git.blahblah.com/DEV001)), for all your work!\n\n#### 🐛 Bug Fix\n\n- Hotfix([PROJ-1234](https://jira.blahblah.com/browse/PROJ-1234): ): use different step size for price and power filter … [#678](https://git.blahblah.com/some/repo/pull/678) ([@DEV001](https://git.blahblah.com/DEV001))\n\n#### Authors: 1\n\n- DevName1 ([@DEV001](https://git.blahblah.com/DEV001))\n\n---

Request for MS Teams WEB Hook:

{
  "@context": "https://schema.org/extensions",
  "@type": "MessageCard",
  "themeColor": "0072C6",
  "title": "Test",
  "text": ":tada: This release contains work from a new contributor! :tada:\n\nThank you, DevName1 ([@DEV001](https://git.blahblah.com/DEV001)), for all your work!\n\n#### 🐛 Bug Fix\n\n- Hotfix([PROJ-1234](https://jira.blahblah.com/browse/PROJ-1234): ): use different step size for price and power filter … [#678](https://git.blahblah.com/some/repo/pull/678) ([@DEV001](https://git.blahblah.com/DEV001))\n\n#### Authors: 1\n\n- DevName1 ([@DEV001](https://git.blahblah.com/DEV001))\n\n---",
}

May be somehow related to sanitizeMarkdown() function inside https://github.com/intuit/auto/blob/main/plugins/microsoft-teams/src/index.ts and https://github.com/intuit/auto/pull/1914 changes.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jakobecommented, Oct 1, 2021

@mathieubergeron @reintroducing @vincentbriglia I can confirm that removing jsesc from the mix now creates nicely formatted release messages in Teams (we create a copy of the plugin wihin our repo and remove jsesc and all is good 👍🏻 )

2reactions
vincentbrigliacommented, Sep 20, 2021

@mathieubergeron @reintroducing i would have never pushed anything that didn’t work at the time, there is no way of double checking now, but it worked for 1 commit and immediately after we got this garbled content also - we just haven’t prioritized the work on our end. Feel free to create a PR, @hipstersmoothie will pull it in without doubt.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Format a message in Teams - Microsoft Support
There are several formatting options for messages. To open your formatting options, select Format Expand button beneath the compose box.
Read more >
Wrong formatting of URLs in Teams messages - Jira
Issue Summary. Wrong formatting of URLs in Teams messages ; Steps to Reproduce. While sending a lot of comments with URLs, then they...
Read more >
Microsoft Teams - Lesson 18 - Formatting Messages - YouTube
In this tutorial, we will be discussing about Formatting Messages Microsoft Teams # microsoftteams #microsoftteamstutorial ...
Read more >
How to Format Messages in Chat on Microsoft Teams
To format a channel conversation, go to 'Teams' on the left navigation bar, and then go to the channel you want to post...
Read more >
Conversational integration with Microsoft Teams - ServiceNow
3. After installation of the plugin, navigate to “Messaging Apps Integrations” and you will see that the “Microsoft Teams” install button is now ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found