Two different variable values in json (current vs selected)

I asked similar question here: Variable namespace - are variables shared between dashboards? , but got no solution.
I checked json of my dashboard and I think I found why variable value differs from set in variable configuration.
I use variable $node_granPeriod value in maths to make it simple to change in future in various graphs.
Select before change: (granPeriod in minutes * 60 sec - here $ne_granPeriod has been set to 15)

SELECT ( ( sum("TermRecCntr") + sum("OrigRecCntr") ) / $ne_granPeriod * 60 ) FROM "..." WHERE ("hostname" =~ /^host1$/) AND $timeFilter GROUP BY time($ne_interval) fill(null)

Select after change (because granPeriod on NE has changed from 15 to 5): here $ne_granPeriod is set to 300 (5*60)

SELECT ( ( sum("TermRecCntr") + sum("OrigRecCntr") ) / $ne_granPeriod ) FROM "..." WHERE ("hostname" =~ /^host1$/) AND $timeFilter GROUP BY time($ne_interval) fill(null)

In json I can see new value (300) - changed from 15, but also still can see value 15 in section “current”

    "current": {
      "selected": true,
      "text": "15",          <<< old value
      "value": "15"          <<< old value
    "hide": 2,
    "label": null,
    "name": "ne_granPeriod",
    "options": [
        "selected": true,
        "text": "300",        <<< new value
        "value": "300"        <<< new value
    "query": "300",
    "skipUrlSync": false,
    "type": "constant"

To fix this (temporarily) I edit $ne_granPeriod definition - and click UPDATE without any changes. Grapsh are plot correctly from that moment but only till I refresh dashboard (even if I saved it first).
Could you tell me how to force dashboard to save new value in all fields in json? Do I use proper variable type (constant)?