diff --git a/jenkins_jobs/modules/properties.py b/jenkins_jobs/modules/properties.py index 9193443be..96685a5e4 100644 --- a/jenkins_jobs/modules/properties.py +++ b/jenkins_jobs/modules/properties.py @@ -529,7 +529,8 @@ def copyartifact(parser, xml_parent, data): raise JenkinsJobsException("projects string must exist and " "not be empty") projectlist = XML.SubElement(copyartifact, 'projectNameList') - XML.SubElement(projectlist, 'string').text = data.get('projects') + for project in str(data.get('projects')).split(','): + XML.SubElement(projectlist, 'string').text = project def batch_tasks(parser, xml_parent, data): diff --git a/tests/properties/fixtures/copyartifact-multiple.xml b/tests/properties/fixtures/copyartifact-multiple.xml new file mode 100644 index 000000000..ac46e518a --- /dev/null +++ b/tests/properties/fixtures/copyartifact-multiple.xml @@ -0,0 +1,11 @@ + + + + + + foo* + bar + + + + diff --git a/tests/properties/fixtures/copyartifact-multiple.yaml b/tests/properties/fixtures/copyartifact-multiple.yaml new file mode 100644 index 000000000..d0f3f9389 --- /dev/null +++ b/tests/properties/fixtures/copyartifact-multiple.yaml @@ -0,0 +1,3 @@ +properties: + - copyartifact: + projects: foo*,bar