diff --git a/roles/custom/matrix-alertmanager-receiver/defaults/main.yml b/roles/custom/matrix-alertmanager-receiver/defaults/main.yml
index 05338c638..697e5cf74 100644
--- a/roles/custom/matrix-alertmanager-receiver/defaults/main.yml
+++ b/roles/custom/matrix-alertmanager-receiver/defaults/main.yml
@@ -205,7 +205,12 @@ matrix_alertmanager_receiver_config_templating_firing_template: |-
# Controls the `templating.resolved-template` configuration setting.
matrix_alertmanager_receiver_config_templating_resolved_template: |-
{% raw %}
- {{ .Alert.Status | ToUpper }}{{ .Alert.Labels.name }}
+ {{ .Alert.Status | ToUpper }}
+ {{ if .Alert.Labels.name }}
+ {{ .Alert.Labels.name }}
+ {{ else if .Alert.Labels.alertname }}
+ {{ .Alert.Labels.alertname }}
+ {{ end }}
{% endraw %}
# Default matrix-alertmanager-receiver configuration template which covers the generic use case.