Before update to 2.7.x version of Jenkins, I used this code to create build variable in job using 'Execute System Groovy Script':
import hudson.model.*
build.addAction(new ParametersAction(new StringParameterValue("var_name", 'foo')))
After update it doesn't work, in log I see:
WARNING hudson.model.Run getEnvVars
deprecated call to Run.getEnvVars
at sun.reflect.GeneratedMethodAccessor1108.invoke(Unknown Source)
Is there any workaround, or how to create variable using Groovy now?