title: "No such DSL method '$' found among steps" error in groovy pipeline script
body: <p>My very first pipeline script is throwing error as below:</p>
  
  <pre><code>Also:   java.lang.NoSuchMethodError: No such DSL method '$' found among steps [ &lt;big text here&gt;]
  </code></pre>
  
  <p>It triggered both the downstream_1 and downstream_2 jobs as expected, but finally failed with above error, here is the groovy script I have, any help/pointers to fix this?</p>
  
  <pre><code>pipeline {
  agent
  {
      node {
              label 'my_server'
            }
  }
  
  stages 
  {
      stage('Start') {
          steps {
              sh 'ls'
          }
      }
  
      stage('End') {
          steps {
              script {
              def jobsString = "downstream_1,downstream_2"
              ArrayList jobsList = jobsString.split('\\,')
  
              def parallelJobs2Run = [:]
              jobsList.each { job -&gt;
                  echo "Run parallel for job ${job}"
                  parallelJobs2Run["${job}"] = { -&gt;
                      echo "Calling job ${job}"
                      jobResults=build job: "${job}",
                      parameters: [
                          string(name: 'param1', value: "value1"),
                          string(name: 'param2', value: "value2")
                      ],
                      propagate: true,
                      wait: true
                      buildNumber = ${jobResults.number}
                      echo "${job} Build number |${buildNumber}| result: |${jobResults.result}|"
                      echo "See details on: |${jobResults.absoluteUrl}|"
                  }
              };
              parallel parallelJobs2Run
              }
          }
      }
  }
  }
  </code></pre>