On 24/03/2012 00:48, Slide wrote:
I use something like this in my groovy template
// the goal is to find the top level job which should contain the changelist
def upstreamBuild = null
def cause = build.causes.find {
if(it instanceof hudson.model.Cause.UpstreamCause) {
return true
}
return false
}
while(cause != null) {
upstreamBuild =
hudson.model.Hudson.instance.getItem(cause.upstreamProject).getBuildByNumber(cause.upstreamBuild)
cause = upstreamBuild.causes.find {
return (it instanceof hudson.model.Cause.UpstreamCause);
}
}
Then I check if upstreamBuild is null or not, and if its not, I have
access to its information like this:
def changeSet = upstreamBuild.changeSet
And you can get the info you are looking for from there.
Wow, cool, I'm afraid I'm a bit clueless though...
Where do I put the code you've written above? File on disk or box in UI?
(it either case, where and called what?)
Once I've done that, how do I wire it into the email-ext template?
cheers,
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk