Pass Jenkins Upstream Job Parameter to Downstream Job

Topic Tools

When we are implementing CI/CD through Jenkins, sometimes there is a need of passing parameter from one job to another job.

Here I am going to demonstrate how to achieve the same.

First of all, Install the Jenkins Parameterized Trigger Plugin – Go to Manage Jenkins and then Click on Manage Plugins


manage plugins

Once done, go to your Upstream Jenkins Job and add the Post Build Action to send the parameter to Downstream Job

Jenkins-Parameter-Upstream-Downstream-01 Jenkins-Parameter-Upstream-Downstream-02

Fill the Downstream Job details and Add the Parameter as “Predefined parameters


Now go to your Downstream Job and use the Build Trigger Option as “This project is parameterised” and you can use the Upstream Build Parameters – I have used the Build Number of Upstream Job


Using inside the Build Job


Now, trigger the Upstream Job


Once the Upstream Job completed, Jenkins will trigger the Downstream Job with the predefined Parameter


In my Case the Build number of Upstream Job was 24 and Downstream Build number is 22 as shown in below screensshot of Downstream Job


You can verify the result that Jenkins is using Upstream Build Number in my Downstream Job


In the same fashion you can use other Upstream Build Parameters and use them in your Downstream Jobs and create the Build/Delivery Pipeline.

Hope you enjoyed today’s article.

Stay tuned for more learning ….

0 comments… add one

Leave a Comment