<p>You can also build a list of parameter objects, then pass that into the build step:</p>

<pre><code>def paramsMap = [:]
paramsMap['param1'] = 'value1'
paramsMap['param2'] = 'value2'
def paramsObjects = []
paramsMap.each {
  key, value -&gt;
    paramsObjects.push([$class: 'StringParameterValue', name: key, value: value])
}
build job: jobName, parameters: paramsObjects
</code></pre>

<p>paramsObjects would look like this:</p>

<pre><code>[
    [$class:StringParameterValue, name:param1, value:value1],
    [$class:StringParameterValue, name:param2, value:value2]
]
</code></pre>

CC BY-SA 3.0
2017-12-14T20:00:04.560Z
2017-12-14T20:00:04.560Z
modle13
<p>You can use a <a href="https://jenkins.io/doc/book/pipeline/" rel="noreferrer">pipeline</a> to tie the jobs together, executing them either in parallel or sequentially through steps.<br>
You can pass the relevant parameters to each job as you call it from the pipeline script.<br>
Then you just need to rebuild a single pipeline job. You can tie the jobs together with a common build name through a variable as well.</p>

<pre><code>build job: 'buildjob1', parameters: [
  [$class: 'StringParameterValue', name: 'BUILD_NAME', value: ${env.JOB_BASE_NAME}-${env.BUILD_NUMBER}"], 
  [$class: 'StringParameterValue', name: 'FIXEDPARAM', value: 'some-string'],
  [$class: 'StringParameterValue', name: 'PARAM1', value: "${PARAM1}"]
]
</code></pre>

CC BY-SA 3.0
2017-03-01T15:08:19.913Z
2017-03-01T15:12:42.387Z
2017-03-01T15:12:42.387Z
Jiri Klouda
<p>I'm using Jenkins <a href="https://wiki.jenkins-ci.org/display/JENKINS/Rebuild+Plugin" rel="noreferrer">Rebuild Plugin</a> to execute a parametrized builds with a single <em>Rebuild</em> button. However when I need to rerun dozens of parametrized jobs (either selected, or from the same folder), it's still not efficient.  </p>

<p>Is there any simpler way (eventually using different plugin) to re-run multiple jobs at the same time using the last used parameters?</p>

CC BY-SA 3.0
2017-03-01T14:17:38.427Z
I'm not aware of a plugin that does multi-rebuild. But I can suggest to maybe take a different approach and use a retry based solution, where any failing build retries itself (according to some configuration). That would sort of make the need to multi-rebuild redundant (at least in some cases).
Assaf Lavie
<jenkins><jenkins-plugins>
How to rebuild multiple jobs at the same time in Jenkins?
kenorb
# How to rebuild multiple jobs at the same time in Jenkins?

(Asked by: username_0 on 2017-03-01)

I'm using Jenkins [Rebuild Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Rebuild+Plugin) to execute a parametrized builds with a single *Rebuild* button. However when I need to rerun dozens of parametrized jobs (either selected, or from the same folder), it's still not efficient.

Is there any simpler way (eventually using different plugin) to re-run multiple jobs at the same time using the last used parameters?

**Tags:** jenkins, jenkins-plugins

> **Comments:**
> **username_1**: I'm not aware of a plugin that does multi-rebuild. But I can suggest to maybe take a different approach and use a retry based solution, where any failing build retries itself (according to some configuration). That would sort of make the need to multi-rebuild redundant (at least in some cases).  

---

## 2 answers

### Answer by username_3 on 2017-03-01. Score: 8 | Accepted answer

You can use a pipeline to tie the jobs together, executing them either in parallel or sequentially through steps.
You can pass the relevant parameters to each job as you call it from the pipeline script.
Then you just need to rebuild a single pipeline job. You can tie the jobs together with a common build name through a variable as well.
build job: 'buildjob1', parameters: [
  [$class: 'StringParameterValue', name: 'BUILD_NAME', value: ${env.JOB_BASE_NAME}-${env.BUILD_NUMBER}"], 
  [$class: 'StringParameterValue', name: 'FIXEDPARAM', value: 'some-string'],
  [$class: 'StringParameterValue', name: 'PARAM1', value: "${PARAM1}"]
]


---

### Answer by username_2 on 2017-12-14. Score: 1

You can also build a list of parameter objects, then pass that into the build step:
def paramsMap = [:]
paramsMap['param1'] = 'value1'
paramsMap['param2'] = 'value2'
def paramsObjects = []
paramsMap.each {
  key, value ->
    paramsObjects.push([$class: 'StringParameterValue', name: key, value: value])
}
build job: jobName, parameters: paramsObjects

paramsObjects would look like this:
[
    [$class:StringParameterValue, name:param1, value:value1],
    [$class:StringParameterValue, name:param2, value:value2]
]


---

