Hello, I’m using Grafana open-source version v10.4.2 (22809dea50455ae875624827dd277b17621b4ed4).
While setting up the Teams Webhook, I encountered an issue: the link in the alert button “View URL” always goes to https://%ip%/alerting/list.
I have properly configured a “Notification Templates”:
Template Teams:
{{ define "__teams_text_alert_list" }}
{{ range . }}
Annotations:
{{ range .Annotations.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}
{{ if gt (len .DashboardURL) 0 }}[Dashboard]({{ .DashboardURL }})
{{ end }}
{{ end }}
{{ end }}
{{ define "teams.my.message" }}
{{ if gt (len .Alerts.Firing) 0 }}**Firing**
{{ template "__teams_text_alert_list" .Alerts.Firing }}
{{ if gt (len .Alerts.Resolved) 0 }}
{{ end }}
{{ end }
{{ if gt (len .Alerts.Resolved) 0 }}**Resolved**
{{ template "__teams_text_alert_list" .Alerts.Resolved }}
{{ end }}
{{ end }}
Message:
Alert summary:
{{ template “teams.my.message” . }}
In the teams.go https://github.com/grafana/alerting/blob/adfb25200d3e7b67633de704211db5191b65bf65/receivers/teams/teams.go#L282C1-L289C4:
L282 - L289
card.AppendItem(AdaptiveCardActionSetItem{
Actions: []AdaptiveCardActionItem{
AdaptiveCardOpenURLActionItem{
Title: "View URL",
URL: receivers.JoinURLPath(tn.tmpl.ExternalURL.String(), "/alerting/list", tn.log),
},
},
})
It’s evident that it’s not a variable but always “/alerting/list”.
To verify and retrieve the content of the request to Teams, the content of the Teams adaptive card:
I noticed there was also a bug for the Alert Slack module:
https://github.com/grafana/grafana/issues/69248
Is there a way to add/fix to be able to change the URL of the “View URL” button or add buttons in the Teams adaptive card?