I want to edit the result of a multi-selection box, with a Groovy script, and then handed over to ANT as an ANT property.
def multiSelectBox = "33 - Settings, 40 - ReleaseNotes, 30 - DuplicateFiles, 7 - NotLinkedCRs"; //vars.get("ResultOfTheMultiSelectionBox")
def result = ""
multiSelectBox.tokenize(',').each
{
result += "$it".substring(0, "$it".indexOf('-')).trim() + ","
}
result = result.substring(0, result.length()-1)
result
The result should be a string ("33,40,30,7"), but it looks like as if Groovy creates a list of it.
I get the following error message!
...Caused by: com.pmease.quickbuild.QuickbuildException: groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.call() is applicable for argument types: (java.lang.String) values: [33,40,30,4,7]
Possible solutions: tail(), wait(), any(), max(), last(), wait(long)...
If I select only one value, then it works!
Does anyone have any idea how to solve the problem?
Thanks
Georg