3

I have dabbled with Parameterized Trigger Plugin but haven't had any luck. What I am basically looking to achieve is pass over the parent job's parameters to the child job. In my parent job, I have defined a variable var whose value at run time I want to be able to pass to the child job Test_child.

enter image description here

enter image description here

In my child job Test_child, following is the set-up:-

enter image description here

And when I echo the same parameter variable in the child job, I don't see any values being passed on.

Balajee Addanki
  • 690
  • 2
  • 9
  • 23

1 Answers1

3

In parent job under Post-build Actions you are using Trigger parameterized build on other projects plugin which is the right method but you are not passing any parameter. You need to add parameter as shown in below image enter image description here

So whatever value is present in var it will be passed to child job and in your case i.e. Test_child and you can use the same variable var in Test_child.

RejeeshChandran
  • 4,168
  • 3
  • 21
  • 32
  • still the same, despite the assignation to a variable. Makes me wonder if I have missed any settings in the `child job`. – Balajee Addanki Jan 13 '17 at 06:05
  • In `Test_child` why are you using `Build after other projects are build` ? It seems to be redundant as you have already configured the same in parent job in `Trigger parameterized build on other projects`. Please remove it and see – RejeeshChandran Jan 13 '17 at 06:20
  • agreed, although, previously there were issues with the child job getting triggered without it. Anyway, I have since your response done the change but don't see the parameter value cascading. – Balajee Addanki Jan 13 '17 at 06:24
  • I'm also using the same plugins and it is working for me. Earlier there was this same issue in Jenkins, see https://issues.jenkins-ci.org/browse/JENKINS-34873 but it is fixed. check it out – RejeeshChandran Jan 13 '17 at 08:28
  • One more thing in `Execute shell`can you use like this `echo $var". – RejeeshChandran Jan 13 '17 at 11:10
  • @BalajeeAddanki - any solution to report? I'm facing a similar problem with the same plugin. – ben_979 Mar 06 '17 at 21:19
  • @ben_979, nope, I haven't – Balajee Addanki Mar 07 '17 at 23:56