JavaPosseRoundup/job-dsl-plugin — pull request #46 by girishpandit88 (2014-02-19 05:43:19+00:00)
Title: Provide a way for use of Jenkins parameter('$' in string form) instead of expected int value in fields

I see that Jenkins allows evaluation of strings at run time in lieu of providing integers in some fields.

One such place is copy artifact. I've created a pipeline job and I'm passing a paramter XYZ assigned with Build Number of upstream job to a job downstream. I tried to use the copyArtifacts(...) as follows -

steps{
copyArtifacts(downstreamUnityJob.name,"target/**"){
buildNumber("\$UNITY_BUILD_NUMBER")
}
}

I get an error -
groovy.lang.MissingMethodException: No signature of method: static javaposse.jobdsl.dsl.helpers.StepContext.buildNumber() is applicable for argument types: (java.lang.String) values: [$UNITY_BUILD_NUMBER]

There should be a way to pass String parameters which are evaluated at run time.