0

Under my pipeline there are 3 jobs. 1st job has one parameter. while Executing pipeline- its prompted me to pass paramters. My third job also has parameters to pass...but its not asking me to pass parameters.

So My pipeline is not getting executed throughly.

enter image description here

2 Answers 2

1

You can use Parameterized Build Plugin to accomplish that.

For example you want your 1st job to trigger the 2nd job (eg. called TEST) and pass a parameter to it. What you need to do is on the 1st job on Post-build Actions section choose Trigger parameterized build on other projects and set it up like the image below:

1st job

On the 2nd job on the General section tick the box This project is parameterized and define the name of the parameter you are passing form the 1st job.

For example:

2nd job

To pass this parameter(or any other parameter) to the 3rd job you need to apply the same approach.

In short:

On 2nd job go to Post-build Actions section choose Trigger parameterized build on other projects and fill the name of the 3rd job in the field Project to build. In the field Predefined parameters add again PARAMETER_NAME=${PARAMETER_NAME}

On 3rd job tick the box This project is parameterized and define the name of the parameter you are passing form the 2nd job (eg. PARAMETER_NAME), for this case as a String Parameter.

Note

You can follow the same logic to pass the parameter(s) to as many downstream jobs you want.

Sign up to request clarification or add additional context in comments.

2 Comments

There are three jobs in my case. I need to pass parameters in my 3rd Job.
You follow the same logic. I have edited the post to include that.
1

Take all the parameters needed int he first job and than pass it to subsequent jobs.

For example --> Job A requires "Param_A", Job B requires "Param_B" and Job C requires "Param_C", than the parent job should take all the three Param in it's input and call the subsequent job with those parameters, and later which ever parameter is required by the job would be utilised by $PARAM_A

1 Comment

I am completely confused here

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.