Thanks everyone! I got it working exactly as I wanted. For any others struggling with the same, here is the solution. Hope it helps someone! :)
*Pipeline job will take parameters like this:* <https://lh3.googleusercontent.com/-kvN2AsQmgw4/V_QRbWRAKTI/AAAAAAAAO5w/lWxTaIR7gWsppmc24cw3QiQs4wCwv3wHwCLcB/s1600/input-parameters.JPG> *The pipeline code:* def ippair = IPADDRESSES.tokenize(",") // The map we'll store the parallel steps in before executing them. def stepsForParallel = [:] for (int i = 0; i < ippair.size(); i++) { // Get the actual string here. def s = ippair.get(i) def stepName = "echoing ${s}" stepsForParallel[stepName] = parallelstep(s) } parallel stepsForParallel def parallelstep(inputString) { return { node { stage('Pair:' + inputString) { echo "Working on the pair:" + inputString ip = inputString.tokenize() echo "The first IP is: " + ip[0] echo "The second IP is: " + ip[1] } //stage block } // node block } //return block } *End output is a list of stages which is variable based on how many pairs of IP's were supplied as parameters. Which is one I wanted exactly. * <https://lh3.googleusercontent.com/-oags2_ip4dk/V_QR4zrQ7SI/AAAAAAAAO50/I0ze1Q9K4g08LkOmH4A4a9usXPAUQzVxwCLcB/s1600/stage-view.JPG> -- 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/a1d1c840-55d2-4e97-835e-2a02b10c1203%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
