Pipeline Syntax -> Global Variables Reference Variable currentBuild irefers to the currently running build. What I needed was the last build of a upstream dependency.
org.jenkinsci.plugins.workflow.job.WorkflowJob job = anotherUpstreamProject. getAllJobs().first() org.jenkinsci.plugins.workflow.job.WorkflowRun build = job.getLastBuild() hudson.model.Result result = build.getResult() List<BuildBadgeAction> badges = build.getBadgeActions() torsdag 4. august 2016 16.53.54 UTC+2 skrev Jesse Glick følgende: > > On Wed, Aug 3, 2016 at 5:14 AM, Sverre Moe <[email protected] > <javascript:>> wrote: > > I need to get the latest build job in my Groovy build script. > > Did you look at the documentation under Global Variables for > `currentBuild`? > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" 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-dev/00f760d3-e9ad-467f-a858-87d4e281eb67%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
