Reputation: 131
I need to get the downstream job details so that I can update this in my Upstream Job short desc or some log file.
But I'm unable to find any call that will work. For getting the Upstream Job info, there is getUpstreamCause(..)
but nothing similar for DownstreamCause
.
Upvotes: 0
Views: 904
Reputation: 1
def startedJobld = build(
job: YOUR_DOWNSTREAM_JOB,
wait: true, // **IMPORTANT, otherwise build () does not return expected object**
propagate: true
println startedJobld .getId()
)
Upvotes: 0
Reputation: 131
I've found a solution to this. Javadoc reference : https://javadoc.jenkins.io/plugin/workflow-support/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.html
def job = build job: 'DownstreamJob'
println job.getId()
The javadoc has all the details I require.
Upvotes: 1