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

Fail to evaluate Boolean parameter to "on" when checked

      When I try to use a Boolean parameter as a reference parameter to an Active Choice Reactive Parameter, it never evaluates to "on".
      I am using Jenkins version: 1.625.1
      I am using latest version of Active Parameter plugin (1.2)
      I am using jQuery plugin version: 1.11.2-0

      Attached please find a example config.xml of a job I have tested on.

          [JENKINS-32044] Fail to evaluate Boolean parameter to "on" when checked

          Bruno P. Kinoshita added a comment - - edited

          Could not reproduce it with 1.580.1 without the JQuery plug-in. Trying with 1.625.3 now.

          Bruno P. Kinoshita added a comment - - edited Could not reproduce it with 1.580.1 without the JQuery plug-in. Trying with 1.625.3 now.

          Working for 1.625.3 + Active Choices 1.2, but no JQuery plug-in.

          Bruno P. Kinoshita added a comment - Working for 1.625.3 + Active Choices 1.2, but no JQuery plug-in.

          Environment settings:

          • Jenkins ver. 1.625.3 (downloaded from jenkins-ci.org, running with a new JENKINS_HOME directory)
          • Job attached (config_2.xml)
          • uno-choice 1.2
          • jquery 1.11.2-0

          The script seemed to work with for both LTS versions tested, with and without the JQuery plug-in.

          Bruno P. Kinoshita added a comment - Environment settings: Jenkins ver. 1.625.3 (downloaded from jenkins-ci.org, running with a new JENKINS_HOME directory) Job attached (config_2.xml) uno-choice 1.2 jquery 1.11.2-0 The script seemed to work with for both LTS versions tested, with and without the JQuery plug-in.

          Could not reproduce it. The script seems to be working as expected. By the default the checkbox is not checked, and the single select value is false. Then if you check the boolean parameter, the cascaded parameter changes its value to true. Firefox 43.0, Ubuntu Server LTS 14.04.3.

          Bruno P. Kinoshita added a comment - Could not reproduce it. The script seems to be working as expected. By the default the checkbox is not checked, and the single select value is false. Then if you check the boolean parameter, the cascaded parameter changes its value to true. Firefox 43.0, Ubuntu Server LTS 14.04.3.

          Gil Shinar added a comment -

          So maybe the issue is with chrome?
          I'll test that with FF

          Gil Shinar added a comment - So maybe the issue is with chrome? I'll test that with FF

          Thanks Gil. I have Chrome and Chromium here, and Safari and IE at work. Let me know if that work or not, and I will confirm what happens in my environment with the other browsers (I can do that anyway in some hours or during the next week). Cutting last release of year in the next days

          Bruno P. Kinoshita added a comment - Thanks Gil. I have Chrome and Chromium here, and Safari and IE at work. Let me know if that work or not, and I will confirm what happens in my environment with the other browsers (I can do that anyway in some hours or during the next week). Cutting last release of year in the next days

          Gil Shinar added a comment - - edited

          Tested it with FF but still same behavior.
          I have tried to set the default value of the Boolean reference to true and now when I press on the "build with parameters" link, it does evaluates to "on" but when I uncheck the Boolean reference, it does not evaluates to other than "on". That is very strange. The only thing that is still different in my environment is the Jenkins version. I have tried to read the changelog but couldn't find anything about Boolean parameters or something like that.
          I'll try to upgrade the Jenkins version to the latest LTS later on today but I doubt it'll solve my issue.
          I really have no clue.

          Gil Shinar added a comment - - edited Tested it with FF but still same behavior. I have tried to set the default value of the Boolean reference to true and now when I press on the "build with parameters" link, it does evaluates to "on" but when I uncheck the Boolean reference, it does not evaluates to other than "on". That is very strange. The only thing that is still different in my environment is the Jenkins version. I have tried to read the changelog but couldn't find anything about Boolean parameters or something like that. I'll try to upgrade the Jenkins version to the latest LTS later on today but I doubt it'll solve my issue. I really have no clue.

          Fixed in 1.3

          Bruno P. Kinoshita added a comment - Fixed in 1.3

          I'm not certain but I think this bug has been re-introduced in a recent version of your plugin. I can reproduce the problem using v1.5.3 on Jenkins LTS core v2.46.3.

          From what I can tell the value of the referenced parameter always receives the same value as it had by default when the build page loads initially. So if the check box is checked by default, the parameter always receives the value of "on" regardless of whether the box is checked or not by the user, and vice versa.

           

          Kevin Phillips added a comment - I'm not certain but I think this bug has been re-introduced in a recent version of your plugin. I can reproduce the problem using v1.5.3 on Jenkins LTS core v2.46.3. From what I can tell the value of the referenced parameter always receives the same value as it had by default when the build page loads initially. So if the check box is checked by default, the parameter always receives the value of "on" regardless of whether the box is checked or not by the user, and vice versa.  

            kinow Bruno P. Kinoshita
            gils Gil Shinar
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: