While I was waiting for a reply I started googling like a nut job, doesn't
help it's my first day with Java either. :) However I managed to rustle up
something up if it's of any use to anyone else.
Cheers.
import hudson.model.*
def lastWorkingBuildCS = build.parent.getLastStableBuild().getChangeSet()
if(lastWorkingBuildCS.history) {
def entry = lastWorkingBuildCS.history[0]
println(entry.change.date)
println(entry.change.changeNumber)
def pa = new ParametersAction([ new
StringParameterValue("P4_LAST_SUCCESS_CHANGE",
String.valueOf(entry.change.changeNumber)) ] )
build.addAction(pa)
}
On Thursday, April 17, 2014 4:32:09 PM UTC+1, slide wrote:
>
> If you use a groovy template, this would be very easy.
>
> def theBuild = Jenkins.instance.getItem('MyBuild').lastSuccessfulBuild
> // do stuff here to access changeNumber from the build object
>
> <http://earl-of-code.com>
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.