This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Microsoft Teams ActiveCard Webhook - using a variable in the URL: field

I have MS Teams working with ActiveCard 1.2 format and webhooks.  I'm happy with the format.  My issue is that MS Teams channels via webhook don't yet support @mentions, so the only way to really filter is to have different alerts go to different channels for the various teams.  I'd really like to do this with 1 alert - the problem is I need a variable working in the URL box.  Right now, variables are rejected for some reason.  Is there a way to get this box to accept a variable so I don't have to make 15 duplicate copies of the same alert with a different URL in each one?  It's just frustrating when you run into little quirks like this.

See sample image - the red highlight is not accepted unless I put a raw URL in there.

URL not accepted.png

Also for reference, here is my ActiveCard I'm using.  The card has several action buttons and an expanding info window that gives out some of our custom fields.  Here is the compact card:

down alert.png

 Here is the same card expanded with more information about the system:

Down Expanded.png

Here is the body of the Post for a Down alert.  I do pull in a lot of custom fields so if you want to use this format you might need to remove them.

{
    "type": "message",
    "attachments": [
        {
            "contentType": "application/vnd.microsoft.card.adaptive",
            "contentUrl": null,
            "content": {
                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                "type": "AdaptiveCard",
                "version": "1.2",
                "body": [


                    {
                        "type":"ColumnSet",
                        "columns":[
                            {
                              "type":"Column",
                              "padding":"None",
                              "width":"auto",
                              "items":[
                                 {
                                    "type":"Image",
                                    "url":"https://www.iconsdb.com/icons/preview/red/down-xxl.png",
                                    "size":"Small"
                                 }
                              ],
                              "horizontalAlignment":"Left"
                           },
                           {
                              "type":"Column",
                              "padding":"None",
                              "width":"stretch",
                              "items":[
                                 {
                                    "type":"TextBlock",
                                    "text":"${N=SwisEntity;M=CustomProperties.Monitoring}: ${N=SwisEntity;M=Caption} at ${IP_Address} is ${N=SwisEntity;M=Status}",
                                    "wrap":true
                                 }
                              ],
                              "verticalContentAlignment":"Center"
                           }

      
                        ] 
                    }


                ],
                    "actions": [
                    {
                        "type": "Action.ShowCard",
                        "title": "More Info",
                        "card": {
                            "type": "AdaptiveCard",
                            "body": [
                                {
                                    "type": "TextBlock",
                                    "text": "Node Name: ${NodeName}",
                                    "size": "Medium",
                                    "wrap": true
                                },                                
                                {
                                    "type": "TextBlock",
                                    "text": "System Name: ${DNS}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "IP Address: ${IP_Address}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "Time of Alert: ${Date} ${Time}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "Monitoring: ${N=SwisEntity;M=CustomProperties.Monitoring}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "Device Type: ${N=SwisEntity;M=CustomProperties.DeviceType}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "Site: ${N=SwisEntity;M=CustomProperties.Site}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "Location: ${location}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "Contact: ${N=SwisEntity;M=Contact}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "Comment: ${N=SwisEntity;M=CustomProperties.Comments}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "EmailPrimary: ${N=SwisEntity;M=CustomProperties.EmailPrimary}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "EmailSecondary: ${N=SwisEntity;M=CustomProperties.EmailSecondary}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "ON Call Text: ${N=SwisEntity;M=CustomProperties.EmailOnCall}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "On Call Escalation: ${N=SwisEntity;M=CustomProperties.EmailEscalation}",
                                    "size": "Medium",
                                    "wrap": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "Open Alert: [${N=Alerting;M=AlertDetailsUrl}](${N=Alerting;M=AlertDetailsUrl})",
                                    "size": "Medium",
                                    "wrap": true
                                },          
                            ],
                            "$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
                        }
                    },     
                    {
                        "type": "Action.OpenUrl",
                        "title": "Open Node",
                        "url": "${N=SwisEntity;M=DetailsUrl}"
                    },
                    {
                        "type": "Action.OpenUrl",
                        "title": "Acknowledge ",
                        "url": "${N=Alerting;M=AcknowledgeLink}"
                    }
                ]
            }
        }
    ]
}
Parents
  • I brought this to their attention 3 months ago as well. This needs to be a thing! Setting the alert to call out the user or group responsible for the alert is the ONLY way to make teams alerts useful. Otherwise,everyone is seeing everything and it just becomes background noise and ignored eventually. This is critical to making the teams alerts an actually useful thing. 

Reply
  • I brought this to their attention 3 months ago as well. This needs to be a thing! Setting the alert to call out the user or group responsible for the alert is the ONLY way to make teams alerts useful. Otherwise,everyone is seeing everything and it just becomes background noise and ignored eventually. This is critical to making the teams alerts an actually useful thing. 

Children
No Data