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.

Set a Variable with an integer value? #4261

aorgas ·

Hello,

Is there a way to set a variable with an integer value from a step log?

i.e.

${
groovy:

import com.pmease.quickbuild.variable.*
import com.pmease.quickbuild.Context;

def choices = vars.getValue("moduleModified");
String[] modules = choices.split(',');
int count = modules.length;
vars.getValue("ModuleModifiedCount").setValue(count);
return count;

}

where moduleModifiedCount is a 'do not prompt' variable.
I get the error: No signature of method: java.lang.String.setValue() is applicable for argument types: (java.lang.String) values: [3]

And when i use 'vars.getIntValue("ModuleModifiedCount").setValue(count);
Error: No signature of method: com.pmease.quickbuild.variable.VariableAccessor.getIntValue() is applicable for argument types: (java.lang.String) values: [ModuleModifiedCount]

First time working with groovy and syntaxes with groovy, a bit confusing, any help would be great!

Thanks!

  • replies 1
  • views 1310
  • stars 0
robinshen ADMIN ·

Please try this:

vars.get("ModuleModifiedCount").setValue(count);