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

'Active Choices Reactive Reference Parameter' type variable is empty

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • active-choices-plugin
    • None
    • Ubuntu 14.04 x86_64
      Jenkins 2.12
      OPEN JDK 1.7
      Active Choices Plug-in 1.4

      In "Build with parameters" page,
      the output of 'Active Choices Reactive Reference Parameter' type
      would display correctly based upon other active choice changes.

      However, during the build,
      the variable to the 'Active Choices Reactive Reference Parameter' type is always empty.

      Jenkins "parameter" page also shows that variable as empty

        1. Selection_001.png
          Selection_001.png
          18 kB
        2. Selection_002.png
          Selection_002.png
          18 kB
        3. Selection_003.png
          Selection_003.png
          12 kB
        4. Selection_004.png
          Selection_004.png
          39 kB
        5. Selection_005.png
          Selection_005.png
          38 kB

          [JENKINS-36509] 'Active Choices Reactive Reference Parameter' type variable is empty

          The Groovy script must return valid HTML in the form:

          return "<input name=\"value\" value=\"${reactRefParam}\" class=\"setting-input\" type=\"text\">"

          where *reactRefParam *is the value calcuclated by the script that you want to use as parameter. In addition, under 'Advanced' options check the 'Omit Value Field'. Make sure you read the documentation on the Active-Choices https://wiki.jenkins-ci.org/display/JENKINS/Active+Choices+Plugin wiki page documenting these techniques under 'Passing Reactive Reference Values to the build' (Scenatio 1, 2)

          Ioannis Moutsatsos added a comment - The Groovy script must return valid HTML in the form: return "<input name=\" value\ " value=\" ${reactRefParam}\ " class=\" setting-input\ " type=\" text\ ">" where *reactRefParam *is the value calcuclated by the script that you want to use as parameter. In addition, under 'Advanced' options check the 'Omit Value Field'. Make sure you read the documentation on the Active-Choices https://wiki.jenkins-ci.org/display/JENKINS/Active+Choices+Plugin wiki page documenting these techniques under 'Passing Reactive Reference Values to the build' (Scenatio 1, 2)

          This is the expected behavior as described on https://wiki.jenkins-ci.org/display/JENKINS/Active+Choices+Plugin. Read instructions on how to pass parameters to the build there please.

          Ioannis Moutsatsos added a comment - This is the expected behavior as described on https://wiki.jenkins-ci.org/display/JENKINS/Active+Choices+Plugin . Read instructions on how to pass parameters to the build there please.

          Rick Liu added a comment -

          Thanks~
          This code is working.
          But is it possible to make the field to be READ-ONLY?

          This field is more like the conclusion field based upon other Active-Choice selections.
          It will display to inform the user's final selection,
          and it will be used inside the Jenkins build.

          return "<input name=\"value\" value=\"${reactRefParam}\" class=\"setting-input\" type=\"text\">"
          

          This code fulfills my requirement.
          It just after Active-Choice updates the field,
          the user might still accidentally changed the text.

          Rick Liu added a comment - Thanks~ This code is working. But is it possible to make the field to be READ-ONLY? This field is more like the conclusion field based upon other Active-Choice selections. It will display to inform the user's final selection, and it will be used inside the Jenkins build. return "<input name=\" value\ " value=\" ${reactRefParam}\ " class=\" setting-input\ " type=\" text\ ">" This code fulfills my requirement. It just after Active-Choice updates the field, the user might still accidentally changed the text.

          Rick Liu added a comment -

          i found a solution to make it read-only using HTML

          return "<input name=\"value\" value=\"${reactRefParam}\" class=\"setting-input\" type=\"text\" readonly>"
          

          Rick Liu added a comment - i found a solution to make it read-only using HTML return "<input name=\" value\ " value=\" ${reactRefParam}\ " class=\" setting-input\ " type=\" text\ " readonly>"

          Thanks for confirming it is working totoroliu. Closing this issue.

          Bruno P. Kinoshita added a comment - Thanks for confirming it is working totoroliu . Closing this issue.

            kinow Bruno P. Kinoshita
            totoroliu Rick Liu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: