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

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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.

      eg.

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

      return[
      'option1',
      'option2:selected',
      'option3'
      ]
      

      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}'.")
      

      Output

      If you build manually you will get:

      *option2*
      

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

      *option1*
      

            Assignee:
            Bruno P. Kinoshita
            Reporter:
            Alin Brados
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: