Solution for How to prevent parameters created with Scripted Pipeline to replace the ones set on the UI?
is Given Below:
With Jenkins Declarative Pipeline syntax, in the parameters
block, the behavior of the parameters is like so:
- If the
defaultValue
of the parameter is customized in the Jenkins UI, it will take precedence over thedefaultValue
in the Jenkinsfile. - It will not remove the parameters which are not defined in code but are set in the UI.
However, if I set any parameters using properties
in a scripted pipeline, the defaultValue
set in the UI gets replaced (1) and parameters not set gets deleted (2).