jenkinsci / jenkinsci/parameterized-trigger-plugin

[JENKINS-60511] parameterized project triggered with empty parameters from pipeline's for loop

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

Description

Scenario

I have two pipeline jobs 'Parent' and 'Child' where 'Child' is parameterized and triggered (fire+forget) from 'Parent' multiple times. The total amount of 'Child' jobs triggered from 'Parent' are variable and depend on external parameters.

 

// Parent.jenkinsfile

pipeline {
agent any
stages {
stage('Trigger Child') {
steps {
script {
for(int i = 0; i < 3; ++i) {
build(
job: 'Child',
parameters: [
string(name: 'alpha', value: 'test'),
string(name: 'beta', value: "${i}")
],
wait: false,
propagate: false)
}
}
}
}
}
}

// Child.jenkinsfile

pipeline {
agent any
parameters {
string(name: 'alpha', description: '', trim: true)
string(name: 'beta', description: '', trim: true)
}
stages {
stage('Hello') {
steps {
buildName "${params.alpha} ${params.beta}"
}
}
}
}

Observed Behaviour

From any run of 'Parent', 'Child' is getting triggered for each set of parameter values AND one additional time with all parameters set to empty values (or their defaults).

In the example above, 'Child' is triggered with the following values:



  1. alpha="", beta="null"  <-- should not be there

  2. alpha="test", beta="0"

  3. alpha="test", beta="1"

  4. alpha="test", beta="2"

Import Note

This spurious job without parameter values is not being triggered when 'Parent' waits for the 'Child' to finish, i.e. if I set wait=true in the build step of 'Parent'.

 

---
Originally reported by tklatt, imported from: parameterized project triggered with empty parameters from pipeline's for loop


  • status: Open
  • priority: Major
  • component(s): parameterized-trigger-plugin, pipeline-build-step-plugin
  • label(s): Jenkinsfile, parameterized-trigger, pipeline
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-07

Raw content of original issue

Scenario

I have two pipeline jobs 'Parent' and 'Child' where 'Child' is parameterized and triggered (fire+forget) from 'Parent' multiple times. The total amount of 'Child' jobs triggered from 'Parent' are variable and depend on external parameters.

 



// Parent.jenkinsfile

pipeline {
agent any
stages {
stage('Trigger Child') {
steps {
script {
for(int i = 0; i < 3; ++i) {
build(
job: 'Child',
parameters: [
string(name: 'alpha', value: 'test'),
string(name: 'beta', value: "${i}")
],
wait: false,
propagate: false)
}
}
}
}
}
}



// Child.jenkinsfile

pipeline {
agent any
parameters {
string(name: 'alpha', description: '', trim: true)
string(name: 'beta', description: '', trim: true)
}
stages {
stage('Hello') {
steps {
buildName "${params.alpha} ${params.beta}"
}
}
}
}


Observed Behaviour

From any run of 'Parent', 'Child' is getting triggered for each set of parameter values AND one additional time with all parameters set to empty values (or their defaults).

In the example above, 'Child' is triggered with the following values:



  1. alpha="", beta="null"  <-- should not be there

  2. alpha="test", beta="0"

  3. alpha="test", beta="1"

  4. alpha="test", beta="2"

Import Note

This spurious job without parameter values is not being triggered when 'Parent' waits for the 'Child' to finish, i.e. if I set wait=true in the build step of 'Parent'.

 

environment

```
Jenkins 2.190.3 (as Docker container)

Parameterized Trigger plugin 2.36

Pipeline: Build Step 2.10
```

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.