Description copied from https://github.com/jenkinsci/promoted-builds-plugin/pull/88
The issue is that jenkins ends up interpreting all configuration as 'latest successful build', regardless of how 'buildSelector' is configured. It looks like the resulting config.xml of the copyArtifacts step is incorrect. Specifically, the class of the selector is missing.
given the following partial dsl:
something like this is generated at the top level:
but this is what is generated within promotions/actions:
The result is Jenkins will mis-interpret the configuration as 'latest' (I'm guessing b/c it's the default class for the selector).
I've tracked it down to hudson.plugins.promoted_builds.integrations.jobdsl.PromotionsExtensionPoint#notifyItemCreated(hudson.model.Item, javaposse.jobdsl.plugin.DslEnvironment, boolean), where the conversion to xml is performed - but I don't know enough to venture a guess as to why it works with standard dsl but not when as a promotion step.