jenkinsci/job-dsl-plugin — pull request #334 by joshuaspence (2014-12-11 23:05:15+00:00)
Title: Fix `copyArtifact`

The `copyArtifact` step is currently broken for matrix projects. The reason for this is that the presence of the `projectName` attributes triggers the `CopyArtifact` plugin to behave differently, as demonstrated below:

```
private boolean upgradeIfNecessary(AbstractProject job) throws IOException {
if (isUpgradeNeeded()) {
int i = projectName.lastIndexOf('/');
if (i != -1 && projectName.indexOf('=', i) != -1 && /* not matrix */Jenkins.getInstance().getItem(projectName, job.getParent(), Job.class) == null) {
project = projectName.substring(0, i);
parameters = projectName.substring(i + 1);
} else {
project = projectName;
parameters = null;
}
LOGGER.log(Level.INFO, "Split {0} into {1} with parameters {2}", new Object[] {projectName, project, parameters});
projectName = null;
job.save();
return true;
} else {
return false;
}
}
```