Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Create vars with groovy #2491

vanderhu ·
Is there any possibility to create vars with groovy? Or should I do something like this then:
def var = new VariableWrapper("test", "abc")
build.variables.put("test", var)

Thanks
  • replies 2
  • views 2512
  • stars 1
robinshen ADMIN ·
Yes this works if you only want variable to appear in current build. If you want variables to store in configuration (so that subsequent builds can use it), you may go with below script running on server:
groovy:
def var = new com.pmease.quickbuild.variable.Variable();
var.setName("test");
var.setValue("abc");
configuration.variables.add(var);
system.configurationManager.save(configuration);
tsad ·
I found on my own <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->

def var = new VariableWrapper("test", "abc")
build.variables.put("test", var)