Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jenkins Parameterized Trigger Plugin doesn't pass parameters downstream

Tags:

jenkins

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.

enter image description here

enter image description here

like image 778
Matoy Avatar asked Oct 19 '22 07:10

Matoy


1 Answers

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.

like image 52
Alex Ho Avatar answered Jan 04 '23 05:01

Alex Ho