Jenkins - How can i pass parameters from the Upstream to Downstream Jenkins - How can i pass parameters from the Upstream to Downstream jenkins jenkins

Jenkins - How can i pass parameters from the Upstream to Downstream


Something like this:

build("B", B_parameter: params["A_parameter"])<br>build("C")

https://wiki.jenkins-ci.org/display/JENKINS/Build+Flow+Plugin


One way to do this is with the Parameterized Trigger plugin: https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin

This allows you to trigger another job using, but not limited to:

* a set of predefined properties * properties from a properties file read from the workspace of the triggering build* the parameters of the current build

With Build A, B, and C you set th3m up as a parameterized builds (i.e. to ask for a value for a parameter). This a setting near the start of the job config page. For example to take a parameter you name MY_ID. This is now accessible as $MY_ID in build A.

Now, when you build A an it prompts for MY_ID. Then add a build step in Job A to trigger "B" with parameters, and pass it all the parameters of build A. Now build B will also have the parameter $MY_ID that was set when you ran a build of A.


Parameterized Trigger Plugin is what you're looking for. For details on how to pass parameter from master build to child build, check my answer in this link.