Here is my problem:
I have the main job (working with the pipeline) and I have x job (freestyle). In my main work, I create an x ββjob using the following:
the code in the main task is
res = build job: 'x', parameters: [string(name: 'JOBNAME', value: string(name: 'JIRACHEF', value: "oldvalue")], quietPeriod: 2
Now in this task x, I change the value of the JIRACHEF parameter, and I print to check if it really has changed:
os.environ["JIRACHEF"] = "newvalue" print os.environ["JIRACHEF"]
This works when outputting the x console of the job. I assume that in accordance with the solution presented, this updated value should now be available in the main task, so I will do the following after the main task right after creating x:
res = build job: 'x', parameters: [string(name: 'JOBNAME', value: string(name: 'JIRACHEF', value: "oldvalue")], quietPeriod: 2 print "$res.buildVariables"
which should print "newvalue" but prints "oldvalue", which leads me to believe that it does not actually pass the value upstream.
Note. I understand that my work x is freestyle, but I tried the above solution, also doing work with the x pipeline and still get the same result - "oldvalue"