[FIXED JENKINS-26119] - Restore the legacy variable escaping approach

Actual change - 4 lines above