Templating: On Time Range Change not save when dashboard exported

I have changed the variables on some dashboards to update “On Time Range Change”. When I export the dashboard, and then re-import it, the variables are reverted to “On Dashboard Load”. Is this expected behavior, or a bug. I’m using grafana 4.3.0-beta1.

When I look in the JSON, I see this for the templating

    "refresh": 1,

But I’m not sure what “1” vs other values mean.

The part of the code responsible for this behaviour is this line where it hard codes the refresh value to 1 on export. This is probably a bug. I’m investigating now and will get back to you shortly.

Footnote: 1 is “On Dashboard Load”, 2 is “On Time Range Change”.

Yes, a bug. I committed a fix for this which will be included in the next release of Grafana in a few week’s time. Thanks for reporting this!