IIUC, there are two different points here:

*1) Variable interpolation.*

It looks like *$COPY_FROM_BUILD* is not interpolated unless it's double 
quoted: 


nextBuildNumber("$COPY_FROM_BUILD") 

*NOTE*: that particular variable might be declared somehow, see below


*2) Upstream parameter.*

Off the top of my head: 

It might depends on how the upstream job triggers the downstream job.


a) If it's using the build step then you might create a new parameter to be 
used only when the upstream pipeline triggered the downstream job which 
will use the parameters accordingly.
b) Using the feature property *'*
*hudson.model.ParametersAction.keepUndefinedParameters'* . (described: 
https://wiki.jenkins.io/display/JENKINS/Features+controlled+by+system+properties)
 
then you won't need to declare the parameter in the downstream job. 
Although, it  might be unsafe as explained
c) Other way, it might be using the archive and copyArtifact 
<https://wiki.jenkins.io/display/JENKINS/Copy+Artifact+Plugin#CopyArtifactPlugin-Pipelinesyntax>
 
step and then readFile step 
<https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-readfile-code-read-file-from-workspace>
d) I'm pretty sure there are other ways that someone else could help with. 
:)


Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3b29cb62-453e-4a37-8b9a-3689467dec5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to