title: Is it possible to set Jenkins job parameters dynamically from a pipeline step?
body: <p>I have the following (simplified) Jenkins pipeline code.</p>
  
  <p>jobParams.groovy</p>
  
  <pre><code>List get(Object paramVars = {}) {
  
      def params = []
  
  
      params += [
          choice(
              choices: ['branch', 'tag'],            
              name: 'RELEASE_TYPE'
          ),
          string(
              defaultValue: '',
              name: 'VERSION'
          ),
      ]
  
      return params
  }
  </code></pre>
  
  <p>pipeline.groovy</p>
  
  <pre><code>def call() {
  
      properties([
          parameters(
              jobParams.get()
          )
      ])
  
      pipeline {
          agent { label 'deploy-slave' }
  
          stages {
              stage('Prepare') {
                  steps {
                      script {
                          // Do some logic here and set a job parameter?
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>This works fine. When the pipeline starts the job parameters are set and available for the next time the job runs.</p>
  
  <p>However, is it also possible to set job parameters dynamically after some logic in a pipeline step?</p>