What about this solution:

import jenkins.model.*
import jenkins.model.node.*
import jenkins.model.slave.*

Jenkins.instance?.items.each { job ->
  if ( job.getLastBuild() != null ) {
      println "${job.name}"
      println "${job.getLastBuild().getNumber()}"

      /// ADDED ///
      def nextBuildNumber = job.getLastBuild().getNumber() + 1
      println "$nextBuildNumber"

  } else {
  }
}

2016-01-08 14:12 GMT+01:00 Slide <slide.o....@gmail.com>:
> Perhaps it should be getNextBuildNumber with a capital N in next? Without
> more details on the error or issue this is only a guess.
>
>
> On Fri, Jan 8, 2016, 06:04 Baptiste Mathus <m...@batmat.net> wrote:
>>
>> a bit too succinct? error? more detailed goal?
>>
>> 2016-01-08 12:55 GMT+00:00 Eric Naitove <enait...@gmail.com>:
>>>
>>> Where am I wrong here.  I have tried several combinations
>>>
>>> import jenkins.model.*
>>> import jenkins.model.node.*
>>> import jenkins.model.slave.*
>>>
>>> Jenkins.instance?.items.each { job ->
>>> if ( job.getLastBuild() != null ) {
>>> println
>>> "${job.name},${job.getLastBuild().getNumber()},${job.getnextBuildNumber().getNumber()}"
>>> } else {
>>> }
>>> }
>>>
>>> --
>>> 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/4b005d29-2939-4688-96e9-53cf03c2b834%40googlegroups.com.
>>> 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/CANWgJS4yO5otVPbz-T4ZTrAMyuxj67DpDFyGvM6exy4nhqmWOw%40mail.gmail.com.
>> 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/CAPiUgVdHKFzePHLoddcD%2BTa0RuijEoSoZ2u5XPRv5VTa-W1JXw%40mail.gmail.com.
>
> 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/CAO5HUhNKM61SjAn1Mc8e5c%3DJ9Fj2KP5Ant-QQOEOb4G2yAR%3DoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to