• Icon: Improvement Improvement
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • None
    • Jenkins ver. 1.656
      Extended Choice Parameter Plug-In 0.63

      I try to create a simpel textbox or a simple select with a groovy script. It is never working. On this page: http://stackoverflow.com/questions/24730186/jenkins-extended-parameter-plugin-groovy-script , there is a comment that is suggesting to just use return ["1","2","3"] as script.

      I tried as in the screenshot with : return ["a","b","c",]

      But nothing comes out.

        1. build.png
          build.png
          23 kB
        2. build1.png
          build1.png
          30 kB
        3. config.png
          config.png
          40 kB
        4. Selection_007.png
          Selection_007.png
          65 kB
        5. Selection_008.png
          Selection_008.png
          3 kB

          [JENKINS-34199] Cannot use a simple Groovy Script

          Nanda Kishore added a comment -

          At the of the "In-process Script Approval" page, where you have "No pending script approvals" as per your picture.

          Nanda Kishore added a comment - At the of the "In-process Script Approval" page, where you have "No pending script approvals" as per your picture.

          vimil added a comment - - edited

          Dav z, do you have security enabled in Jenkins? You will see entries there only if security is enabled.If you don't have security enabled then you don't need to approve groovy scripts. They should work without script approval.

          I couldn't repro this issue on my machine. I use 0.63 version of the plugin on jenkins 1.654.

          here is how my configuration screen looks like.

          here is how the build page looks like

          Can you check the Jenkins system log to see there are any exceptions there?
          You can find this under 'Manage Jenkins'

          vimil added a comment - - edited Dav z, do you have security enabled in Jenkins? You will see entries there only if security is enabled.If you don't have security enabled then you don't need to approve groovy scripts. They should work without script approval. I couldn't repro this issue on my machine. I use 0.63 version of the plugin on jenkins 1.654. here is how my configuration screen looks like. here is how the build page looks like Can you check the Jenkins system log to see there are any exceptions there? You can find this under 'Manage Jenkins'

          Davide Z. added a comment -

          vimil, yes I have security enabled in /configureSecurity/

          Digging a bit int the log show that a script required approval, so wend back to the approval page and this time there was an approval button.

          So now I can embed a groovy script. But it seems that I cannot load it . I tried both using the the absolute path and relative to the Job but nothing shows up. Also nothing comes up in the log file when the file cannot be found

          Davide Z. added a comment - vimil, yes I have security enabled in /configureSecurity/ Digging a bit int the log show that a script required approval, so wend back to the approval page and this time there was an approval button. So now I can embed a groovy script. But it seems that I cannot load it . I tried both using the the absolute path and relative to the Job but nothing shows up. Also nothing comes up in the log file when the file cannot be found

          vimil added a comment -

          So If I understand correctly, you can use the groovy script option but not the groovy script-file option?

          vimil added a comment - So If I understand correctly, you can use the groovy script option but not the groovy script-file option?

          Davide Z. added a comment -

          correct I can create an inline script [where you type the script in the text area] fine. The script is excuted correctly.

          But when I try to use an external file, nothing is happening. I checked the jenkins log and there are no file not found.

          Maybe is the path incorrect, which one should I use ? Absolute or relative [to what in case] ?

          Davide Z. added a comment - correct I can create an inline script [where you type the script in the text area] fine. The script is excuted correctly. But when I try to use an external file, nothing is happening. I checked the jenkins log and there are no file not found. Maybe is the path incorrect, which one should I use ? Absolute or relative [to what in case] ?

          vimil added a comment -

          Dav z,

          You should use an absolute path. Let me verify that I am able to repro your issue and get back to you

          vimil added a comment - Dav z, You should use an absolute path. Let me verify that I am able to repro your issue and get back to you

          vimil added a comment -

          I tested this with version 0.63 version of the plugin on jenkins 1.654. and was not able to repro the issue. Below is the screenshot of my configuration.

          vimil added a comment - I tested this with version 0.63 version of the plugin on jenkins 1.654. and was not able to repro the issue. Below is the screenshot of my configuration.

          Nanda Kishore added a comment -

          I can use a groovy script. There was problem with a regex I was using in the script. Thanks and sorry of the trouble.

          Nanda Kishore added a comment - I can use a groovy script. There was problem with a regex I was using in the script. Thanks and sorry of the trouble.

          vimil added a comment -

          I am marking this issue as cannot repro

          vimil added a comment - I am marking this issue as cannot repro

          Davide Z. added a comment -

          All worked at the end for me. Using the absolute path did the trick

          Davide Z. added a comment - All worked at the end for me. Using the absolute path did the trick

            vimil vimil
            dawez Davide Z.
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: