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

REST API buildWithParameters not working

XMLWordPrintable

      I am unable to use the REST API buildWithParameters.

       

      The job has a user-defined axis, Client, with a list of client names. Each one builds a job with client specific values. I want to be able to pass the parameter "Client" to this URL to build a job for that single axis entry, or multiple of.

       

      The job gets created, however the client parameter is never set, with this error

      No such property: ClientName for class: groovy.lang.Binding
      09:52:45 groovy.lang.MissingPropertyException: No such property: ClientName for class: groovy.lang.Binding
      09:52:45     at groovy.lang.Binding.getVariable(Binding.java:63)
      09:52:45     at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:285)
      09:52:45     at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:375)
      09:52:45     at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:379)
      09:52:45     at org.kohsuke.groovy.sandbox.impl.Checker$checkedGetProperty.callStatic(Unknown Source)
      09:52:45     at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:55)
      09:52:45     at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:197)
      09:52:45     at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:233)
      09:52:45     at Script1.run(Script1.groovy:1)
      09:52:45     at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runScript(GroovySandbox.java:195)
      09:52:45     at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.run(GroovySandbox.java:363)
      09:52:45     at hudson.matrix.FilterScript.evaluate(FilterScript.java:45)
      09:52:45     at hudson.matrix.FilterScript.apply(FilterScript.java:85)
      09:52:45     at hudson.matrix.Combination.evalGroovyExpression(Combination.java:102)
      09:52:45     at hudson.matrix.Combination.evalGroovyExpression(Combination.java:91)
      09:52:45     at hudson.plugins.matrix_configuration_parameter.DefaultMatrixCombinationsParameterValue.combinationExists(DefaultMatrixCombinationsParameterValue.java:82)
      09:52:45     at hudson.plugins.matrix_configuration_parameter.MatrixCombinationsParameterMatrixBuildListener.doBuildConfiguration(MatrixCombinationsParameterMatrixBuildListener.java:57)
      09:52:45     at hudson.matrix.listeners.MatrixBuildListener.buildConfiguration(MatrixBuildListener.java:70)
      09:52:45     at hudson.matrix.DefaultMatrixExecutionStrategyImpl.filterConfigurations(DefaultMatrixExecutionStrategyImpl.java:188)
      09:52:45     at hudson.matrix.DefaultMatrixExecutionStrategyImpl.run(DefaultMatrixExecutionStrategyImpl.java:123)
      09:52:45     at hudson.matrix.MatrixBuild$MatrixBuildExecution.doRun(MatrixBuild.java:375)
      09:52:45     at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526)
      09:52:45     at hudson.model.Run.execute(Run.java:1895)
      09:52:45     at hudson.matrix.MatrixBuild.run(MatrixBuild.java:323)
      09:52:45     at hudson.model.ResourceController.execute(ResourceController.java:101)
      09:52:45     at hudson.model.Executor.run(Executor.java:442)

      Where "ClientName" is one of the values in the axis.

            kohsuke Kohsuke Kawaguchi
            mr_pablo Paul
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: