diff --git a/jenkins_jobs/modules/view_list.py b/jenkins_jobs/modules/view_list.py
index 1d17b4341..e9946f951 100644
--- a/jenkins_jobs/modules/view_list.py
+++ b/jenkins_jobs/modules/view_list.py
@@ -187,6 +187,17 @@ to the :ref:`view_list` definition.
* **permission-check**: ('str'): Match user permissions.
(default MustMatchAll)
+ * **upstream-downstream** (`dict`)
+ :upstream-downstream:
+ * **include-upstream** ('bool'): Jobs that match upstream.
+ (default False)
+ * **include-downstream** ('bool'): Jobs that match downstream.
+ (default False)
+ * **recursive** ('bool'): Jobs that are recursive.
+ (default False)
+ * **exclude-originals** ('bool'): Jobs that are originals.
+ (default False)
+
* **columns** (`list`): List of columns to be shown in view.
* **regex** (`str`): . Regular expression for selecting jobs
(optional)
@@ -325,6 +336,21 @@ class List(jenkins_jobs.modules.base.Base):
convert_mapping_to_xml(js_xml, js_data, mapping,
fail_required=True)
+ if jobfilter == 'upstream-downstream':
+ ud_xml = XML.SubElement(job_filter_xml,
+ 'hudson.views.UpstreamDownstreamJobsFilter')
+ ud_xml.set('plugin', 'view-job-filters')
+ ud_data = jobfilters.get('upstream-downstream')
+ mapping = [
+ ('include-upstream', 'includeUpstream',
+ False),
+ ('include-downstream', 'includeDownstream', False),
+ ('recursive', 'recursive', False),
+ ('exclude-originals', 'excludeOriginals', False),
+ ]
+ convert_mapping_to_xml(ud_xml, ud_data, mapping,
+ fail_required=True)
+
if jobfilter == 'fallback':
fb_xml = XML.SubElement(job_filter_xml,
'hudson.views.AddRemoveFallbackFilter')
diff --git a/tests/views/fixtures/view_list_upstream_downstream_filter_full.xml b/tests/views/fixtures/view_list_upstream_downstream_filter_full.xml
new file mode 100644
index 000000000..160d8f50d
--- /dev/null
+++ b/tests/views/fixtures/view_list_upstream_downstream_filter_full.xml
@@ -0,0 +1,30 @@
+
+
+ list-view-name01
+ Sample description
+ true
+ true
+
+
+
+
+
+
+ true
+ true
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ true
+ false
+
diff --git a/tests/views/fixtures/view_list_upstream_downstream_filter_full.yaml b/tests/views/fixtures/view_list_upstream_downstream_filter_full.yaml
new file mode 100644
index 000000000..2e56e2068
--- /dev/null
+++ b/tests/views/fixtures/view_list_upstream_downstream_filter_full.yaml
@@ -0,0 +1,13 @@
+name: list-view-name01
+view-type: list
+description: 'Sample description'
+filter-executors: true
+filter-queue: true
+job-filters:
+ upstream-downstream:
+ include-downstream: true
+ include-upstream: true
+ recursive: true
+ exclude-originals: true
+recurse: true
+status-filter: false
diff --git a/tests/views/fixtures/view_list_upstream_downstream_filter_min.xml b/tests/views/fixtures/view_list_upstream_downstream_filter_min.xml
new file mode 100644
index 000000000..6fcf2a09e
--- /dev/null
+++ b/tests/views/fixtures/view_list_upstream_downstream_filter_min.xml
@@ -0,0 +1,30 @@
+
+
+ list-view-name01
+ Sample description
+ true
+ true
+
+
+
+
+
+
+ false
+ false
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+ true
+ false
+
diff --git a/tests/views/fixtures/view_list_upstream_downstream_filter_min.yaml b/tests/views/fixtures/view_list_upstream_downstream_filter_min.yaml
new file mode 100644
index 000000000..099189d7c
--- /dev/null
+++ b/tests/views/fixtures/view_list_upstream_downstream_filter_min.yaml
@@ -0,0 +1,10 @@
+name: list-view-name01
+view-type: list
+description: 'Sample description'
+filter-executors: true
+filter-queue: true
+job-filters:
+ upstream-downstream:
+ include-downstream: false
+recurse: true
+status-filter: false