Promoted builds do not receive parameterized builds

Issue

  • Promoted build step ignores build parameters.
  • Promoted build step does not receive any parameterized build options.
  • I am receiving the following error after upgrading Jenkins:
FATAL: Illegal choice for parameter PARAMETER: $PARAMETER 
java.lang.IllegalArgumentException: Illegal choice for parameter PARAMETER: $PARAMETER
at hudson.model.ChoiceParameterDefinition.checkValue(ChoiceParameterDefinition.java:79) 
at hudson.model.ChoiceParameterDefinition.createValue(ChoiceParameterDefinition.java:91) 
at hudson.model.ChoiceParameterDefinition.createValue(ChoiceParameterDefinition.java:19) 
at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.convertToDefinedType(ProjectSpecificParameterValuesActionTransform.java:82) 
at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.transformParametersAction(ProjectSpecificParameterValuesActionTransform.java:33) 
at hudson.plugins.parameterizedtrigger.ProjectSpecificParametersActionFactory.getProjectSpecificBuildActions(ProjectSpecificParametersActionFactory.java:33) 
at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getBuildActions(BuildTriggerConfig.java:351) 
at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.perform(BuildTriggerConfig.java:372) 
at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:83) 
at hudson.plugins.promoted_builds.Promotion$RunnerImpl.build(Promotion.java:403) 
at hudson.plugins.promoted_builds.Promotion$RunnerImpl.doRun(Promotion.java:345) 
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) 
at hudson.model.Run.execute(Run.java:1738) 
at hudson.model.Run.run(Run.java:1676) 
at hudson.plugins.promoted_builds.Promotion.run(Promotion.java:284) 
at hudson.model.ResourceController.execute(ResourceController.java:98) 
at hudson.model.Executor.run(Executor.java:410) 
Finished: FAILURE

Environment

  • Jenkins LTS 1.651.2
  • CloudBees Jenkins Enterprise 1.651.2.1
  • Parameterized Build

Resolution

Due to the security fix in: Jenkins Security Advisory 2016-05-11
caused a regression in the promoted builds plugin which does ignores parameterized build configuration: JENKINS-34826.

As of writing this article the only known workaround is to add the parameter configuration to the promoted build job.

Workaround Steps

1 . First step is to grab the parameter name (In my example I used REMOTE_SSH)

1a . Example of my promoted build using the parameter and passing it to another remote job:

2 . On the left side of the job page is a link called “Promotion Status”. Click that link:

3 . After clicking on the link then click on the name of the promotion job:

4 . After clicking on the promotion job click on the configure link:

5 . Configure a paramaterized build option and click save (it can be a String parameter):
Note: Make sure it contains the same parameterized variable name as the one from the promoted build.

6 . After clicking save you can trigger a new build which will properly pass the parameterized build configuration to the downstream job:

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.