I have configured jenkinsfile with below properties, but it doesn't apply on jenkins server when creating a new branch from master branch.
#!groovy
properties([[$class: 'ParametersDefinitionProperty',
parameterDefinitions: [
[$class: 'StringParameterDefinition', name: 'isValid', defaultValue: 'false']
]
]])
node {
stage 'Checkout'
checkout scm
.....
.....
}
After branch created in git, the branch is visible in the jenkins server with Build Now option.
Once I run the branch first time from the jenkins server, it is changed into Build with Parameters option.
Is there anything I missed to configure in jenkinsfile? Why the parameters not configured in the jenkins server at branch creation?
You can get around this by using params.isValid instead of env.isValid.
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