title: IllegalArgumentException: Expected named arguments (Jenkins)
body: <p>I am getting the following error when trying to run my jenkins job. Any help would be much appreciated</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Expected named arguments but got
    [org.jenkinsci.plugins.workflow.cps.CpsClosure2@33c7c4a6,
    org.jenkinsci.plugins.workflow.cps.CpsClosure2@79505a8c,
    org.jenkinsci.plugins.workflow.cps.CpsClosure2@6a96df3,
    org.jenkinsci.plugins.workflow.cps.CpsClosure2@1a0cb771,
    org.jenkinsci.plugins.workflow.cps.CpsClosure2@17e3a262]  at
    org.jenkinsci.plugins.workflow.cps.DSL.singleParam(DSL.java:606)  at
    org.jenkinsci.plugins.workflow.cps.DSL.parseArgs(DSL.java:594)    at
    org.jenkinsci.plugins.workflow.cps.DSL.parseArgs(DSL.java:534)    at
    org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:219)   at
    org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:178)     at
    org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
      at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)</p>
  </blockquote>
  
  <p>My code is: </p>
  
  <pre><code>node("dvsacvsmgmt") {
  
      stage("Build") {
  
          def buildJobs = []
          for (BACKEND_SERVICE in BACKEND_SERVICES) {
              SVC = BACKEND_SERVICE.replaceAll('-','_')
  
              switch (BRANCH_SVC) {
                  case ["develop","master"]:
                      def buildJob = {
                          build "${ROOT_FOLDER}/2_Build/Backend/${SVC}/job_build_backend_" + BRANCH_SVC + "_" + SVC +".groovy"
                      }
                      buildJobs.add(buildJob)
                  break
                  default:
                      def buildJob = {
                          build "job_${SVC}": "${ROOT_FOLDER}/2_Build/Backend/${SVC}/job_build_backend_" + BRANCH_SVC + "_" + SVC +".groovy",
                                  parameters: [gitParameter(name: "BRANCH", value: BRANCH_SVC)]
                      }
                      buildJobs.add(buildJob)
                  break
              }
          }
          parallel(buildJobs)
      }
  }
  </code></pre>
  
  <p><strong>NOTE:</strong> My variables are defined at the top, </p>
  
  <blockquote>
    <p><strong>BRANCH, BRANCH_SVC, ROOT_FOLDER, BACKEND_SERVICES</strong> </p>
  </blockquote>