My approach has just been iteratively trying things with the Script Console 
up in one window and the Javadoc up in other windows. I'm unsure if there 
is an easier way to learn it.

On Thursday, December 10, 2015 at 6:18:28 AM UTC-8, Guy Matz wrote:
>
> Nicely done!!  How the heck was I supposed to know that!?  :-(  The API is 
> less than intuitive and does not seem to be well documented.  Any advice on 
> how to best use it?
>
> Thanks again!!
>
> On Wed, Dec 9, 2015 at 7:28 PM, Christopher Orr <ch...@orr.me.uk 
> <javascript:>> wrote:
>
>> Hi there,
>>
>> On 09/12/15 23:40, Guy Matz wrote:
>> > Hi!  Anyone know how I can retrieve the git revision from a job?
>> >
>> > I can get to the build:
>> >
>> > j = Jenkins.instance.getJob('render-master')
>> > b475 = j.getBuildByNumber(475)
>> >
>> > but I can't find a way to to get the git revision associated with that
>> > build.  Any thoughts would be appreciated!
>>
>> Git metadata is stored in a `BuildData` action, so something like this
>> (untested) should work:
>>
>>
>> b475.getAction(hudson.plugins.git.util.BuildData.class).lastBuiltRevision.sha1String
>>
>> Regards,
>> Chris
>>
>> --
>> 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 jenkinsci-use...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/5668C714.30504%40orr.me.uk
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/dfa91529-2347-493c-83e1-8065e5d07491%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to