How to access upstream job variable from downstream job, withhout modifying groovy pipeline script.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to access upstream job variable from downstream job, withhout modifying groovy pipeline script.

kenzu
I have multiple pipelines written in groovy that call a job.
I need to pass the upstream job name to a downstream job, and I'd like to do so without modifying every pipeline by sending the parametized job name environment variable to the job.
I'm trying to find a way to do so from the downstream job itself.
The job has this information, since it knows which job is calling itself.
The Cause object has this information, but the environment variables in each run only show BUILD_CAUSE_UPSTREAMTRIGGER, and BUILD_CAUSE, it does not give me the NAME of the job that triggered it.
I'd like to find a way to add a string parameter to the downstream job so I can pass it to the script that is being executed.Thanks.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e630be3d-a943-423c-809b-5c0033d6b0e3n%40googlegroups.com.