Trigger build parameters not getting passed downstream

Jenkins with version >2.1 has this issue while using Parameterized Trigger Plugin . Because of the security issue, we are not able to pass parameter used in upstream job to be passed into downstream job.

The following workaround will certainly help.

In the startline of jenkins add the following:

-Dhudson.model.ParametersAction.keepUndefinedParameters=true

In my case startline file of jenkins will reside on /etc/default/jenkins. In that file, add the code into JAVA_ARGS. This will then be passed to java.

By default the code segment looks like this.

# arguments to pass to java
JAVA_ARGS=”-Djava.awt.headless=true” # Allow graphs etc. to…..
#JAVA_ARGS=”-Xmx256m”
#JAVA_ARGS=”-Djava.net.preferIPv4Stack=true” # make jenkins listen…

Change this segment , so that it looks like this

# arguments to pass to java
JAVA_ARGS=”-Djava.awt.headless=true -Dhudson.model.ParametersAction.keepUndefinedParameters=true”
#JAVA_ARGS=”-Xmx256m”
#JAVA_ARGS=”-Djava.net.preferIPv4Stack=true”

The location of startline file for jenkins may vary for different system and with different version of jenkins.

In centOs, this location would be:

vi /etc/sysconfig/jenkins

I hope this helped you.