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

return all selected values, when gets the default value

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • active-choices-plugin
    • None

      Currently taken is the first value from listy. We need returned all selected value as default.

      Eg. Parameter definition (Choice type: Check boxes)

      When I run manually I got

      and sample results

      Run jobs run_job_a,run_job_b
      

      When I run with http://jenkins:8080/job/jobName/buildWithParameters (use curl)
      I got

      Run jobs run_job_a:selected
      

      but I need the same value (all selected)

          [JENKINS-36948] return all selected values, when gets the default value

          Boguslaw Klimas added a comment - I created pull request for this https://github.com/jenkinsci/active-choices-plugin/pull/10

          Any update for this?

          Boguslaw Klimas added a comment - Any update for this?

          Hi klimas7,

          I think the pull request looks good, but maybe we are fixing the wrong issue.

          When you open the browser, and you have an HTML DOM, the plug-in inspects it, evals the code, and does not use the getDefaultParameterValue. Instead, it will evaluate the right value, given your Groovy script.

          What your pull request is doing, is basically changing the default parameter value, to return the script return value. The default behavior is simply return the first element, unless you specify otherwise.

          At the moment the plug-in *needs* a HTML DOM, and is not fully tested being used with curl, Pipeline Plug-in, or with different plug-ins.

          There are other issues that are aiming at making the plug-in compatible with headless environments, running in a pipeline, etc. Fixing those issues, would also fix your issue I think.

          Bruno P. Kinoshita added a comment - Hi klimas7 , I think the pull request looks good, but maybe we are fixing the wrong issue. When you open the browser, and you have an HTML DOM, the plug-in inspects it, evals the code, and does not use the getDefaultParameterValue. Instead, it will evaluate the right value, given your Groovy script. What your pull request is doing, is basically changing the default parameter value, to return the script return value. The default behavior is simply return the first element, unless you specify otherwise. At the moment the plug-in * needs * a HTML DOM, and is not fully tested being used with curl, Pipeline Plug-in, or with different plug-ins. There are other issues that are aiming at making the plug-in compatible with headless environments, running in a pipeline, etc. Fixing those issues, would also fix your issue I think.

            kinow Bruno P. Kinoshita
            klimas7 Boguslaw Klimas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: