I was able to programmatically generate an input form based on a list of 
parameters

@NonCPS

def createBooleanParameter(String desc, String value){

   return [$class: 'BooleanParameterDefinition', defaultValue: true, 
description: desc, name: value]

}

 node {

 def userInput = input(

 id: 'userInput', message: 'The below Scenarios failed, let\'s rerun them?', 
parameters: [

    createBooleanParameter('ScenarioA','Platform1-VariantA'),

    createBooleanParameter('ScenarioB','Platform1-VariantB'),

    createBooleanParameter('ScenarioC','Platform3-VariantA')

 ])

 
 // BooleanParameters are based on Key=> String based and Value=> Boolean based
 // then iterate through the list of parameters which are enable

 userInput?.findAll{ it.value }?.each {

    println it.key.toString()

 }



But unfortunately I need a bit more of dynamism, which means, I'd need to 
inject those input parameters on the fly since I don't know them until 
certain stage of the pipeline.

Cheers


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8ae59501-a7ba-47c1-bb9c-97fdb726759b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to