Alerts to MS-Teams with Runbook

Hello,

I am sending alerts to Microsoft teams,
when I hit “Runbook Url” button it will redirect me to this link "https://teams.microsoft.com/null"

I add this custom JSON Payload
{
@type”: “MessageCard”,
@context”: “https://schema.org/extensions”,
“summary”: “Incident $INCIDENT_ID $EVENT_STATE”,
“themeColor”: “B286BC”,
“sections”: [
{
“startGroup”: true,
“title”: “$CONDITION_NAME incident $EVENT_STATE”,
“activityImage”: “https://static.intercomassets.com/avatars/792690/square_128/newrelic_logo-1476726027.png?1476726027”,
“activityTitle”: “$EVENT_DETAILS”,
“activitySubtitle”: “$SEVERITY $EVENT_TYPE ($INCIDENT_ID)”,
“facts”: [
{
“name”: “Open violations:”,
“value”: “critical $OPEN_VIOLATIONS_COUNT_CRITICAL / warning $OPEN_VIOLATIONS_COUNT_WARNING”
},
{
“name”: “Closed violations:”,
“value”: “critical $CLOSED_VIOLATIONS_COUNT_CRITICAL / warning $CLOSED_VIOLATIONS_COUNT_WARNING”
},
{
“name”: “Current owner:”,
“value”: “$EVENT_OWNER”
}
]
},
{
“text”: “See the triggering query in Insights”,
“images”: [
{
“image”: “$VIOLATION_CHART_URL”
}
],
“heroImage”: {
“image”: “$VIOLATION_CHART_URL”
}
},
{
“potentialAction”: [
{
@type”: “OpenUri”,
“name”: “Details”,
“targets”: [
{
“os”: “default”,
“uri”: “$INCIDENT_URL”
}
]
},
{
@type”: “OpenUri”,
“name”: “Acknowledge”,
“targets”: [
{
“os”: “default”,
“uri”: “$INCIDENT_ACKNOWLEDGE_URL”
}
]
},
{
@type”: “OpenUri”,
“name”: “Runbook”,
“targets”: [
{
“os”: “default”,
“uri”: “$RUNBOOK_URL”
}
]
}
]
},
{
“startGroup”: true,
“activitySubtitle”: “Alert sent by NewRelic for the account “$ACCOUNT_NAME” according to the $POLICY_NAME event policy.”
}
]
}

Hi there @proplab -

It sounds like you are using the default webhook payload template, but it’s giving you an error. Our experience has been that Teams is parsing things a bit differently, and so lots of folks have struggled with this.

We have a feature idea on the books for a full integration, but I don’t have a timeline on that. You can add your perspective here:

In the meantime, did you see this thread:

New Relic alerts not working with Microsoft Teams Alerts

I spent some time getting a more detailed card working, based on the templated variables that are made available. It shows the information neatly, and it’s better than sending an email to the channel. There are a couple of caveats: the notifications all look the same regardless of the event type – acknowledgement is a full notification. It would be better to be able to say “incident was acknowledged by John West”, but you can’t. heroImage doesn’t render for me in my channel, but the images s…

A couple of folks here have provided customized payload templates that could get you what you need.

Let me know if I misunderstood you or if you need anything else!

1 Like
Thanks for your reply

I found the solution by sending the Runbook in text, like this:
"text": "Check [Runbook URL]($RUNBOOK_URL)"
2 Likes