I have a onestep in Cherwell that based on a criteria triggers a webservice and sends a MessageCard over to a Channel in MS Teams. I cannot find a way to trigger an @mention when the message lands in the channel. With the current WFH all the technicians are in Teams and no so much on email so a Cherwell notification email may go unread for a while. If the @mention was a thing then we have a more dynamic response to some of these incidents that we need someone to jump on when they come into the system Thanks.
-
I have tried "
@NAME " and the <> values are removed so it seems Teams knows there something that should be actioned, it just doesn't trigger the mention. – Stevenls Apr 29 '20 at 06:10 -
3@mention is supported only in adaptive card currently. Not supported for message card. – Subhasish Apr 29 '20 at 11:29
-
ah that is a shame as you are forced to use MessageCard when using a push to teams. – Stevenls Apr 29 '20 at 22:45
-
1Teams bots, messaging extensions, and the Bot Framework support Adaptive Cards. Teams connectors do not currently support Adaptive Cards. However, it is possible to create a [flow](https://flow.microsoft.com/en-us/blog/microsoft-flow-in-microsoft-teams/) that posts adaptive cards to a Teams channel. – Subhasish Apr 30 '20 at 05:58
-
I looked at Flow as I saw that mentioned somewhere else but couldn't see how I would connect the Cherwell webservice to Flow. I do't have the Flow connector in Teams so maybe the answer is there if I had it. But I am assuming if there is a URI like there is with the o365 connector then Cherwell purshes to that and then Flow into Teams? – Stevenls Apr 30 '20 at 22:40
1 Answers
As of 21/09/2021, Microsoft has documentation for how this will be supported. However, Teams doesn't yet (Oct 2021) trigger the actual notification, see below.
Copying from the documentation:
User mention in Incoming Webhook with Adaptive Cards Incoming webhooks start to support user mention in Adaptive Cards with the AAD Object ID and UPN.
Note
Enable user mention in the schema for Incoming webhooks to support AAD Object ID and UPN. UI/UX changes are not required for user mentions with AAD Object ID and UPN. The activity feed notification for Incoming Webhook with user mention will be available in the future release.
Example for user mention in Incoming Webhook as follows:
JSON
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "Sample Adaptive Card with User Mention"
},
{
"type": "TextBlock",
"text": "Hi <at>Adele UPN</at>, <at>Adele AAD</at>"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0",
"msteams": {
"entities": [
{
"type": "mention",
"text": "<at>Adele UPN</at>",
"mentioned": {
"id": "AdeleV@contoso.onmicrosoft.com",
"name": "Adele Vance"
}
},
{
"type": "mention",
"text": "<at>Adele AAD</at>",
"mentioned": {
"id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
"name": "Adele Vance"
}
}
]
}
}
}]
}
Following image illustrates user mention in Incoming Webhook:
For completeness, this is the code I used to test the above:
HttpResponseMessage response = await new HttpClient().PostAsync("https://XXXXXXX.webhook.office.com/webhookb2/XXXXXXXXXXX/IncomingWebhook/XXXXX/XXXXXXXXXXX",
new StringContent(cardWithMentionsAsJsonString, Encoding.UTF8, "application/json"));

- 391
- 4
- 12
-
2Perhaps they are doing a staged rollout. For me it's still not working, i.e. there is no notification. – lapis Oct 31 '21 at 11:55
-
1@lapislast No, I think you are right, this must be still not be fully implemented. A colleague confirmed the same thing, and I meant to come here and edit the answer, but I forgot (I'll do it now). I must not have been very thorough with my initial testing... I think I had turned on whole-channel notifications at the time, and I confused those as the @-mention working... Sorry about that. – kostasvs Oct 31 '21 at 15:46
-
1
-
@MrDysprosium: perhaps you don't need the user guids. MS's example above shows that this feature should also work with just the email addresses. If you can't deduce those emails for some reason, maybe you want to look into the MS Graph API, if you use Azure AD. That will give you the guids too. – kostasvs Mar 25 '22 at 16:09
-
It implies the UPN rather than the email works, but unfortunately in my experience it still doesn't. I don't think it is possible to do this for an incoming webhook today. – sahmeepee Mar 08 '23 at 12:01