jenkinsci / jenkinsci/parameterized-trigger-plugin

[JENKINS-62717] Parameterized trigger plugin evaluates null or unset variables as their symbol name.

Open
#779 3 comments 0 reactions 0 assignees View on GitHub
component:parameterized-trigger-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
77
Forks
174
Avg merge
22h 27m
Merged PRs (30d)
1

Description

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?)

---
Originally reported by rusty, imported from: Parameterized trigger plugin evaluates null or unset variables as their symbol name.


  • status: Open
  • priority: Major
  • component(s): parameterized-trigger-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 2025-12-07

Raw content of original issue

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?)

  • environment: Jenkins ver. 2.222.3

1 attachment

- [image-2020-06-18-16-39-18-616.png](https://issues.jenkins.io/secure/attachment/51676/image-2020-06-18-16-39-18-616.png)
> ![image-2020-06-18-16-39-18-616.png](https://issues.jenkins.io/secure/attachment/51676/image-2020-06-18-16-39-18-616.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.