I'm sure there's an easy answer for this but I was unable to find it elsewhere.
I have a Jenkins workflow job with parameters. What I want is to skip a build job depending on the value of a parameter. Something like:
if(param["MYPARAM"]){
build("jorb1")
}
build("jorb2")
Does anyone know how I'd accomplish this?
Turns out the answer is really easy. Hopefully this will help someone else. If statements do work in the DSL configuration. I guess its based on groovy (which I have zero experience with). Anyway my guess was just about right other than specifying the params incorrectly. Below is an example of checking a string parameter:
if(params["MYPARAM"]=="some_value"){
build("jorb1")
}
build("jorb2")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With