You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting a variable in a loop in the "Edit Routing Template" window, the variable in the loop is forgotten once the loop is exited.
An example of this can be seen with the code below
{% set flag = true %}
{% for alert in payload.alerts %}
{# We set the flag to be false, to demonstrate it doesnt change outside the loop #}
{% set flag = false %}
{{ "Confirming we are in a loop." }}
{% endfor %}
{% if flag %}
The flag is still true.
{% else %}
The flag is false now.
{% endif %}
Gives the result:
X Confirming we are in a loop. The flag is still true.
Selected alert will not be matched with this route
What did you expect to happen?
The result should be:
X Confirming we are in a loop. The flag is false now.
Selected alert will not be matched with this route
As we set the variable to be false in the loop.
Did this work before?
I dont know
How do we reproduce it?
Copy code from example into the "Edit Routing Template" window.
Select a demo rule with 1 or more alerts in the alerts array. Any array to loop over instead of payload.alerts can be used.
Result is not the expected result
Is the bug inside a dashboard panel?
no
Environment (with versions)?
Grafana: Cloud
OS: MacOS
Browser: Firefox and Safari
Grafana platform?
I use Grafana Cloud
Datasource(s)?
No response
The text was updated successfully, but these errors were encountered:
What happened?
When setting a variable in a loop in the "Edit Routing Template" window, the variable in the loop is forgotten once the loop is exited.
An example of this can be seen with the code below
Gives the result:
What did you expect to happen?
The result should be:
As we set the variable to be false in the loop.
Did this work before?
I dont know
How do we reproduce it?
Is the bug inside a dashboard panel?
no
Environment (with versions)?
Grafana: Cloud
OS: MacOS
Browser: Firefox and Safari
Grafana platform?
I use Grafana Cloud
Datasource(s)?
No response
The text was updated successfully, but these errors were encountered: