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

Groovy script and scriptText REST interface should accept parameters

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      At the moment there is no way to pass parameters for groovy remote script execution via script or scriptText POST requests. One of the option that can be used to provide arguments can be implemented via POST request query attribute-value pairs, like

      http://localhost:8080/scriptText?param1=value1&param2=value2 ...

      Correspondingly, the groovy script can be provided with parameters using binding either for each attribute (excluding such default parameters like: script which contains the script code itself or r which corresponds to result, etc.), or via dedicated binding query or any suitable.

        Attachments

          Activity

          Hide
          grayaii Alex Gray added a comment -

          The workaround that I use is via the jenkins-cli:

          java -jar jenkins-cli.jar -remoting groovy foo.groovy myargs

           

          Ideally, the scriptText endpoint should support it.  I'm not sure how the jenkins-cli is doing it though.

          Show
          grayaii Alex Gray added a comment - The workaround that I use is via the jenkins-cli: java -jar jenkins-cli.jar -remoting groovy foo.groovy myargs   Ideally, the scriptText endpoint should support it.  I'm not sure how the jenkins-cli is doing it though.

            People

            • Assignee:
              Unassigned
              Reporter:
              kyr Kyr Shatskyy
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: