I have 2 jobs. I want the 1st job to trigger the 2nd job with parameters from the 1st job.
I was managed to have a properties file containing these parameters (key=value) and using the inject env plugin I was also managed to have these parameters are defined in my 1st job's parameters.
Now the problem:
I tried triggering the 2nd job with predefined parameters (i.e id=$id). That didn't work. The 2nd job got this parameter: id=$id (the string $id) and not the value of the id from 1st job. this although $id value is defined in 1st job.
I also tried giving the properties file as parameter. didn't work as well. got no parameters from it for the 2nd job.
What version of Jenkins are you running?
I encountered this problem today and it looks like environment variables cannot be passed due to a security vulnerability.
https://wiki.jenkins-ci.org/display/JENKINS/Plugins+affected+by+fix+for+SECURITY-170
Workaround provided -
As this change is known to affect a number of plugins, it's possible to restore the previous behavior by setting the system property hudson.model.ParametersAction.keepUndefinedParameters to true. This is potentially very unsafe and intended as a short-term workaround only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With