-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins ver. 2.222.3
I have 2 jobs Job A and Job B.
1. Job A does some logic and then injects some variables into the build via the inject variable plugin. The only variable that is set is $PARAM1, and occasionally $PARAM2
2. Job A then runs a parameterized trigger for Job B. Job B requires two parameters: PARAM1 and PARAM2. Both parameters of this job default to blank strings. The trigger is parameterized and passes the following "pre-defined" parameters to Job B as follows:
PARAM1=$PARAM1
PARAM2=$PARAM2
See attached photo:
3. While parsing the parameters for Job B, because PARAM2 is not defined. Instead of passing a blank string to Job B, PARAM2 is set to the literal string '$PARAM2'.
4. This then causes a world of chaos in Job B because not only is PARAM2 not set to a blank string, but it is also set to a wildly incorrect value.
Echoing out these values in Job B will show the following:
The parameter PARAM1="I was set and injected in the last job"
The parameter PARAM2="$PARAM2"
The fix for this seems simple enough and that is to evaluate all symbols that aren't set as either blank strings "" or refuse to set the variable in the downstream project allowing the default parameter to take precedence (Maybe configurable?)