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

The selected option from Active Choice Parameter groovy script is not used when building a job periodically (using cron)


    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • active-choices-plugin
    • None

      Steps to reproduce:

      Given: I install the Active Choice Parameter plugin
      When: I configure a job to have an Active Choice Parameter having a Groovy script
      And: I set an option as selected in the Groovy script, but not the first option
      And: I configure the job to build periodically (using cron)
      Then: The job should start with the selected option as for the parameter value

      Instead: The job starts with the first option from the groovy script and not with the selected one.


      Having one Active Choice parameter, named "options" defined by the following Groovy script:


      Then, if you build the project by using a system groovy script like this:

      import hudson.model.*
      // get ACP 'options'
      def resolver = build.buildVariableResolver
      def optionsACPValue = resolver.resolve("options").toString()
      // print 'options' ACP value
      println ("ACP value: '$\{optionsACPValue}'.")


      If you build manually you will get:


      and if you build periodically (using cron), the output will be:


            kinow Bruno P. Kinoshita
            alin_brados Alin Brados
            8 Vote for this issue
            11 Start watching this issue