Seems to be reported as JENKINS-11691 [1] linked to JENKINS-7162 [2]

As parameters are handled in the own page in the UI, which creates 
the ParametersAction with all of the displayed items including the defaults 
that are populated there is no problem.

>From the CLI code it is a different case.

Just had a look at the code in the BuildCommand.java [3], and in this case 
it just checks that the parameter name passed in is correct, there is no 
checking of all the parameter definitions that are attached to the project 
to get the missing entries.

            for (Entry<String, String> e : parameters.entrySet()) {
                String name = e.getKey();
                ParameterDefinition pd = pdp.getParameterDefinition(name);
                if (pd==null)
                    throw new AbortException(String.format("\'%s\' is not a 
valid parameter. Did you mean %s?",
                            name, EditDistance.findNearest(name, 
pdp.getParameterDefinitionNames())));
                values.add(pd.createValue(this,e.getValue()));
            }
            
            a = new ParametersAction(values);


This should add the missing parameters using the default values.

[1] https://issues.jenkins-ci.org/browse/JENKINS-11691 
[2] https://issues.jenkins-ci.org/browse/JENKINS-7162
[3] 
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/cli/BuildCommand.java#L100


Chris.

On Tuesday, August 14, 2012 1:17:49 PM UTC+1, Adam Aquilon wrote:
>
> Did you ever get a response to this problem?
> Or maybe found a workaround?
>
> We have a "Dual Jenkins" solution (master/slave) to help us handle 
> upgrades and config changes to our jenkins instance(es) in a "safer" 
> manner, but it relies on using JCLI as opposed to RESTful calls. This bug 
> or shortcoming prevents us from starting to use the Dual Jenkins solution, 
> and we *really* need the JCLI build command to retrieve default parameter 
> values for all parameters not included as -p arguments!
>
>

Reply via email to