cjo9900 commented on Bug JENKINS-7162

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 [1], 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://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/cli/BuildCommand.java#L100

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to