Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
If you have a parameterized job with multiple parameters, all with default values, you can trigger it via an upstream build and all parameters have the default value as expected. This also works when building it via the CLI if you don't specify parameters.
However as soon as you specify one parameter like "-p PARAM1=foo" then all the other parameters lose their default value and are blank for the build.
I would expect that specifying one parameter should still allow others to get the default, otherwise in our scripts that invoke CLI builds, we have to put in every parameter and duplicate the default value which is error-prone and is easy to forget when changing one. Confirmed with a fresh and clean 1.370 Hudson.
Attachments
Issue Links
- is duplicated by
-
JENKINS-11691 Triggering jobs via CLI ignores default parameter values
-
- Resolved
-
Pull request PULL 540 added to fix this.[1]
Add all the job defined Parameters to the ParameterAction using Defaults
if not passed via the command line.
If this breaks backwards compatibility where these are not expected to be passed, we can introduce a new option to use the defaults for parameters which triggers this behaviour.
@Option(name="-d",usage="Use defaults for parameters not specified, only valid when -p is used")
public boolean parameterDefaults = false;
[1] https://github.com/jenkinsci/jenkins/pull/540