Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-71649

Reporting of schedule details not working for parameterized schedules

      The script below will pull the schedules for regular schedules, but cannot seem to pull for parameterized schedules.  Since parameterized schedules are based on the regular ones, I would have thought this should still work.

      I would like to know how to pull a summary report that includes the parameterized schedules.

      Are there new TriggerDescriptors configured?  Any different content a script would need to query?

       

      import hudson.model.*
      import hudson.triggers.*
      TriggerDescriptor TIMER_TRIGGER_DESCRIPTOR = Hudson.instance.getDescriptorOrDie(TimerTrigger.class)

      println ( "### CONFIGURED SCHEDULES ###" )
      println ( "---------------------------------------------------------------------" )

      for (item in Jenkins.instance.getAllItems(Job)) {
          def timertrigger = item.getTriggers().get(TIMER_TRIGGER_DESCRIPTOR)
          if (timertrigger)

      {             println ( item.getTriggers().get(TIMER_TRIGGER_DESCRIPTOR).spec + "    " + item.fullName )               println ( "---------------------------------------------------------------------" )     }

      }

          [JENKINS-71649] Reporting of schedule details not working for parameterized schedules

          David added a comment - - edited

          With some troubleshooting, I've found a solution, that generally needed only the following:
          import org.jenkinsci.plugins.parameterizedscheduler.*
          TriggerDescriptor PARMTIMER_TRIGGER_DESCRIPTOR = Hudson.instance.getDescriptorOrDie(ParameterizedTimerTrigger.class)

          item.getTriggers().get(PARMTIMER_TRIGGER_DESCRIPTOR).parameterizedSpecification

          The full working script that will report both regular and parameterized schedules is attached.

          .List Parameterized schedules Groovy.txt

          We run it from the groovy console

          David added a comment - - edited With some troubleshooting, I've found a solution, that generally needed only the following: import org.jenkinsci.plugins.parameterizedscheduler.* TriggerDescriptor PARMTIMER_TRIGGER_DESCRIPTOR = Hudson.instance.getDescriptorOrDie(ParameterizedTimerTrigger.class) item.getTriggers().get(PARMTIMER_TRIGGER_DESCRIPTOR).parameterizedSpecification The full working script that will report both regular and parameterized schedules is attached. . List Parameterized schedules Groovy.txt We run it from the groovy console

            batmat Baptiste Mathus
            david_dean2 David
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: