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

HTML-formatted (reactive reference) boolean/checkbox input parameters do not pass on values, only true/false

XMLWordPrintable

      I am using an Active Choices Reactive Reference Parameter to render HTML inputs.

      In the HTML, if I set the input type to text, the values are passed along to the pipeline correctly.

      If I set the input type to checkbox, the values are not passed along, only true/false.

      The desired behaviour does work as expected if I use a regular Active Choices Parameter with 'Choice Type' set to checkboxes, however this does not allow me to use custom HTML.

       

      WORKS: Groovy script (Regular Active Choices Parameter):

      return ['dog', 'cat', 'mouse']

       

      NOT WORKING: Groovy script (Reactive Reference - Formatted HTML):

      options = ['dog', 'cat', 'mouse']
      output = ""
      options.each { thing ->
          output += """<input type="checkbox" name="value" value="${thing}">${thing}<br/>"""
      }
      return output

      Sample pipeline:

       

      pipeline {
          agent any
          stages {
              stage('Test checkboxes') {
                  steps {
                      echo "ACTIVE: ${params.ACTIVE_CHECKBOXES}"
                      echo "REACTIVE: ${params.REACTIVE_CHECKBOXES}"
                  }
              }
          }
      }
      

       

      Run pipeline:

       

      Output:

      [Pipeline] stage
      [Pipeline] { (Test checkboxes)
      [Pipeline] echo
      ACTIVE: cat,mouse
      [Pipeline] echo
      REACTIVE: true,true,false

       

      More info:

      If I change the input type to 'radio' or 'text', behaviour is again as expected.

      [Pipeline] echo
      REACTIVE: dog

      [Pipeline] echo
      REACTIVE: dog,cat,mouse

            ioannis Ioannis Moutsatsos
            denhamcoote Denham Coote
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: