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
Once done, go to your Upstream Jenkins Job and add the Post Build Action to send the parameter to Downstream Job
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 ….