Tirumalesh Y
Tirumalesh Y

Reputation: 51

MS Teams Bot: Adaptive Card User Mention Not Working

I am trying to mention a user in an Adaptive Card sent by a Microsoft Teams bot, but the mention is not working as expected. Below is the Adaptive Card template I am using:

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.6",
  "body": [
    {
      "type": "TextBlock",
      "text": "On-call users for: ${shiftDate}",
      "weight": "Bolder",
      "size": "Large",
      "wrap": true
    },
    {
      "type": "TextBlock",
      "text": "Schedule: ${scheduleName}",
      "weight": "Bolder",
      "size": "Medium",
      "wrap": true
    },
    {
      "type": "FactSet",
      "facts": "${data}"
    },
    {
      "type": "ActionSet",
      "actions": [
        {
          "type": "Action.OpenUrl",
          "title": "View Full Schedule",
          "url": "${baseUrl}/abc/abcd?scheduleid=${scheduleId}"
        }
      ],
      "msteams": {
        "entities": [
          {
            "type": "mention",
            "text": "<at>john</at>",
            "mentioned": {
              "id": "[email protected]",
              "name": "john"
            }
          }
        ]
      }
    }
  ]
}

After sending the message to the Teams channel, I can see the card and other details, but the user mention (john) does not trigger the expected mention behavior in Microsoft Teams. The text is displayed as-is and does not show up as a clickable mention in the Teams chat.

What I've Tried:

Ensured that the user ID and email are correct. Verified the correct Adaptive Card version (1.6). Tried different formats for the mention but nothing seems to work. Questions:

Is there something I am missing in the card definition that would allow mentions to work? Do mentions in Adaptive Cards need to follow a specific format or configuration for MS Teams bots? Are there additional settings required to enable mentions in Teams bot messages? Any help would be greatly appreciated!

Upvotes: 0

Views: 176

Answers (0)

Related Questions