Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select All Choices in Jenkins Groovy

I want to select all the choices in my Groovy script so it defaults to all. I am using the Active Choices Reactive Parameter because I am reading in the previous option. How do I make my "output" variable so it is all selected without having the user select them all?

def output = []
def line
def release = RELEASE_NUMBER
releaseNumber = release.replaceAll("\\n", "");
String[] number = releaseNumber.split("\\.");

def list = "cmd /c e:\\tools\\wget --no-check-certificate --http-user=username--http-password=password-qO- \"https://1.1.1.1:443/svn/Instructions/trunk/${number[0]}.${number[1]}.${number[2]}/ICAN/EI_${releaseNumber}.txt\"".execute().text
list.eachLine {
     if (it.contains("- LH")) {
         String newName = it.replaceAll("\\s", "");
         String newName2 = newName.replaceAll("-", "");
         output.add(newName2)
     }
}
return output
like image 517
Ryan Johnson Avatar asked Oct 31 '25 23:10

Ryan Johnson


1 Answers

I don't know anything about Jenkins, but reading the documentation for the plugin you mention you should be able to simply use output.add("${newName2}:selected").

like image 158
sensei Avatar answered Nov 04 '25 08:11

sensei