Created
June 28, 2016 14:52
-
-
Save kmadel/766c8d4bea0cd58d0ae087f16a67d14e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (cause in currentBuild.rawBuild.getCauses()) { | |
if (cause instanceof Cause.UpstreamCause) { | |
def upstreamProjectName = cause.getUpstreamProject() | |
echo upstreamProjectName | |
def job = hudson.model.Hudson.instance.getItem(upstreamProjectName) | |
def build = job.getBuildByNumber(cause.getUpstreamBuild()) | |
echo build.buildVariableResolver.resolve("version") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment