diff --git a/jenkins_jobs/modules/builders.py b/jenkins_jobs/modules/builders.py
index c162df0d5..5065226b5 100644
--- a/jenkins_jobs/modules/builders.py
+++ b/jenkins_jobs/modules/builders.py
@@ -285,6 +285,11 @@ def trigger_builds(parser, xml_parent, data):
:arg str project: the Jenkins project to trigger
:arg str predefined-parameters:
key/value pairs to be passed to the job (optional)
+ :arg list bool-parameters:
+
+ :Bool: * **name** (`str`) -- Parameter name
+ * **value** (`bool`) -- Value to set (default false)
+
:arg str property-file:
Pass properties from file to the other job (optional)
:arg bool property-file-fail-on-missing:
@@ -400,6 +405,20 @@ def trigger_builds(parser, xml_parent, data):
'PredefinedBuildParameters')
properties = XML.SubElement(params, 'properties')
properties.text = project_def['predefined-parameters']
+
+ if 'bool-parameters' in project_def:
+ params = XML.SubElement(tconfigs,
+ 'hudson.plugins.parameterizedtrigger.'
+ 'BooleanParameters')
+ configs = XML.SubElement(params, 'configs')
+ for bool_param in project_def['bool-parameters']:
+ param = XML.SubElement(configs,
+ 'hudson.plugins.parameterizedtrigger.'
+ 'BooleanParameterConfig')
+ XML.SubElement(param, 'name').text = str(bool_param['name'])
+ XML.SubElement(param, 'value').text = str(
+ bool_param.get('value', False)).lower()
+
if(len(list(tconfigs)) == 0):
tconfigs.set('class', 'java.util.Collections$EmptyList')
diff --git a/tests/builders/fixtures/trigger-builds003.xml b/tests/builders/fixtures/trigger-builds003.xml
index 74278e3c3..492f91d4b 100644
--- a/tests/builders/fixtures/trigger-builds003.xml
+++ b/tests/builders/fixtures/trigger-builds003.xml
@@ -9,6 +9,22 @@
FOO="bar"
+
+
+
+ PARAM1
+ false
+
+
+ PARAM2
+ true
+
+
+ PARAM3
+ false
+
+
+
build_started
ALWAYS
diff --git a/tests/builders/fixtures/trigger-builds003.yaml b/tests/builders/fixtures/trigger-builds003.yaml
index 77afa2b22..0a4d9e9e9 100644
--- a/tests/builders/fixtures/trigger-builds003.yaml
+++ b/tests/builders/fixtures/trigger-builds003.yaml
@@ -3,5 +3,11 @@ builders:
- project: "build_started"
predefined-parameters:
FOO="bar"
+ bool-parameters:
+ - name: "PARAM1"
+ value: false
+ - name: "PARAM2"
+ value: true
+ - name: "PARAM3"
block: true
same-node: true