title: How to pass paramaters to a pipelineJob in DSL
body: <p>I have very similar pipeline jobs that have only differences are parameters. The goal is to create these jobs by passing parameters in a DSL script without any code duplication.</p>
  
  <p>I followed <a href="http://dev.to/jalogut/centralise-jenkins-pipelines-configuration-using-shared-libraries" rel="nofollow noreferrer">this article</a>. So If you run the DSL script below after you implemented the steps as mentioned in the article, my script able to run.</p>
  
  <p>TL;DR 
  In that article adds a shared library and also have Jenkinsfile use that shared library.</p>
  
  <p>I have a very similar approach. The difference is I want to create my build jobs via DSL and, changes default parameters of the Jenkinsfile by settings on the DSL. </p>
  
  <p>The question is how can I pass/override parameters in the Jenkinsfile.</p>
  
  <pre><code>// BTW I'll run this code below in a loop. Open for any suggesstion 
  pipelineJob('AwesomeBild') {
  
      description("A pipeline created by dsl")
  
      definition {
          cpsScm {
              scm {
                  git {
                      remote { url('https://github.com/jalogut/jenkinsfile-shared-library-sample.git') }
                      branches('master')
                      // how can I pass params to the file
                      scriptPath('Jenkinsfile')
                      extensions { }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>Parameters worked well. Here is the lastest version of the DSL file.</p>
  
  <pre><code>pipelineJob('AwesomeBild') {
  
      description("A pipeline created by dsl")
  
  
      parameters {
          stringParam( "key", "value" )
      }
  
      definition {
          cpsScm {
              scm {
                  git {
                      remote { url('https://github.com/jalogut/jenkinsfile-shared-library-sample.git') }
                      branches('master')
                      // how can I pass params to the file
                      scriptPath('Jenkinsfile')
                      extensions { }
                  }
              }
          }
      }
  }
  </code></pre>