Grafana Alerting Templating Labels

Hi All!

So I was wondering if anyone knows how to input logic into the grafana labels templates?

The reason i am asking is because i want to set labels based on thresholds, so from one rule i can say severity = notify, warning, critical. To do this i wanted to put some logic in the label template. I found in the documentation we can do this :

{{ if $values.B }}{{ $labels.instance }} has a 95th percentile request latency above 1s: {{ $values.B }}){{ end }}

But wanted to say something like {{ if $values.B == 5 }}{{this_value}}{{ else }}{{this_othervalue}}{{end}}


Bump. Does anyone have any tips?