How to pass the Job name and build number as parameter to another jenkins job?

Viewed 13654

I have two Jenkins Jobs - JobA and JobB.

I need to start execution of JobB when JobA has finished building and I need to pass the Job name (i.e. 'JobA') and the latest build number (the build that just completed) to JobB.

Along with these, I also need to pass the original parameters that were passed to JobA, to be passed to JobB

I have added a post build action in JobA - Trigger parameterized build on other projects and specified JobB in the projects to build. within this, I have also added a parameter - Current build parameters, which will pass the current parameters to the next job.

I have also added a build trigger in JobB - Build after other projects are built and specified JobA as the Project Name.

Now, how do I pass the jobName and buildNumber of JobA to JobB?

1 Answers
Related