diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py
index fef4ec275..04d591cdb 100644
--- a/jenkins_jobs/modules/publishers.py
+++ b/jenkins_jobs/modules/publishers.py
@@ -2926,10 +2926,16 @@ def workspace_cleanup(registry, xml_parent, data):
     :arg str external-deletion-command: external deletion command to run
         against files and directories
 
-    Example:
+    Minimal Example:
 
     .. literalinclude::
-        /../../tests/publishers/fixtures/workspace-cleanup001.yaml
+        /../../tests/publishers/fixtures/workspace-cleanup-minimal.yaml
+       :language: yaml
+
+    Full Example:
+
+    .. literalinclude::
+        /../../tests/publishers/fixtures/workspace-cleanup-complete.yaml
        :language: yaml
     """
 
@@ -2949,12 +2955,12 @@ def workspace_cleanup(registry, xml_parent, data):
         XML.SubElement(ptrn, 'pattern').text = exc
         XML.SubElement(ptrn, 'type').text = "EXCLUDE"
 
-    XML.SubElement(p, 'deleteDirs').text = \
-        str(data.get("dirmatch", False)).lower()
-    XML.SubElement(p, 'cleanupMatrixParent').text = \
-        str(data.get("clean-parent", False)).lower()
-    XML.SubElement(p, 'externalDelete').text = \
-        str(data.get('external-deletion-command', ''))
+    mappings = [
+        ('dirmatch', 'deleteDirs', False),
+        ('clean-parent', 'cleanupMatrixParent', False),
+        ('external-deletion-command', 'externalDelete', '')
+    ]
+    helpers.convert_mapping_to_xml(p, data, mappings, fail_required=True)
 
     mask = [('success', 'cleanWhenSuccess'),
             ('unstable', 'cleanWhenUnstable'),
diff --git a/tests/publishers/fixtures/workspace-cleanup-complete.xml b/tests/publishers/fixtures/workspace-cleanup-complete.xml
new file mode 100644
index 000000000..d55638632
--- /dev/null
+++ b/tests/publishers/fixtures/workspace-cleanup-complete.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project>
+  <publishers>
+    <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
+      <patterns>
+        <hudson.plugins.ws__cleanup.Pattern>
+          <pattern>*.zip</pattern>
+          <type>INCLUDE</type>
+        </hudson.plugins.ws__cleanup.Pattern>
+        <hudson.plugins.ws__cleanup.Pattern>
+          <pattern>*.txt</pattern>
+          <type>EXCLUDE</type>
+        </hudson.plugins.ws__cleanup.Pattern>
+      </patterns>
+      <deleteDirs>true</deleteDirs>
+      <cleanupMatrixParent>true</cleanupMatrixParent>
+      <externalDelete>command</externalDelete>
+      <cleanWhenSuccess>false</cleanWhenSuccess>
+      <cleanWhenUnstable>false</cleanWhenUnstable>
+      <cleanWhenFailure>false</cleanWhenFailure>
+      <cleanWhenNotBuilt>false</cleanWhenNotBuilt>
+      <cleanWhenAborted>false</cleanWhenAborted>
+      <notFailBuild>true</notFailBuild>
+    </hudson.plugins.ws__cleanup.WsCleanup>
+  </publishers>
+</project>
diff --git a/tests/publishers/fixtures/workspace-cleanup-complete.yaml b/tests/publishers/fixtures/workspace-cleanup-complete.yaml
new file mode 100644
index 000000000..1ea41495b
--- /dev/null
+++ b/tests/publishers/fixtures/workspace-cleanup-complete.yaml
@@ -0,0 +1,16 @@
+publishers:
+  - workspace-cleanup:
+      include:
+        - "*.zip"
+      exclude:
+        - "*.txt"
+      clean-if:
+        - success: false
+        - unstable: false
+        - failure: false
+        - aborted: false
+        - not-built: false
+      dirmatch: true
+      fail-build: false
+      clean-parent: true
+      external-deletion-command: 'command'
diff --git a/tests/publishers/fixtures/workspace-cleanup001.xml b/tests/publishers/fixtures/workspace-cleanup-minimal.xml
similarity index 69%
rename from tests/publishers/fixtures/workspace-cleanup001.xml
rename to tests/publishers/fixtures/workspace-cleanup-minimal.xml
index 192948746..36f0e03ef 100644
--- a/tests/publishers/fixtures/workspace-cleanup001.xml
+++ b/tests/publishers/fixtures/workspace-cleanup-minimal.xml
@@ -2,19 +2,13 @@
 <project>
   <publishers>
     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
-      <patterns>
-        <hudson.plugins.ws__cleanup.Pattern>
-          <pattern>*.zip</pattern>
-          <type>INCLUDE</type>
-        </hudson.plugins.ws__cleanup.Pattern>
-      </patterns>
       <deleteDirs>false</deleteDirs>
       <cleanupMatrixParent>false</cleanupMatrixParent>
       <externalDelete/>
       <cleanWhenSuccess>true</cleanWhenSuccess>
       <cleanWhenUnstable>true</cleanWhenUnstable>
       <cleanWhenFailure>true</cleanWhenFailure>
-      <cleanWhenNotBuilt>false</cleanWhenNotBuilt>
+      <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
       <cleanWhenAborted>true</cleanWhenAborted>
       <notFailBuild>true</notFailBuild>
     </hudson.plugins.ws__cleanup.WsCleanup>
diff --git a/tests/publishers/fixtures/workspace-cleanup-minimal.yaml b/tests/publishers/fixtures/workspace-cleanup-minimal.yaml
new file mode 100644
index 000000000..aa91ee6b2
--- /dev/null
+++ b/tests/publishers/fixtures/workspace-cleanup-minimal.yaml
@@ -0,0 +1,2 @@
+publishers:
+  - workspace-cleanup
diff --git a/tests/publishers/fixtures/workspace-cleanup001.yaml b/tests/publishers/fixtures/workspace-cleanup001.yaml
deleted file mode 100644
index 79caf3b73..000000000
--- a/tests/publishers/fixtures/workspace-cleanup001.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-publishers:
-  - workspace-cleanup:
-      include:
-        - "*.zip"
-      clean-if:
-        - success: true
-        - not-built: false