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

parameter of type run not added to params

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • core
    • None

      parameters of type run are not accessible by params. They are exposed as env:

      Jenkinsfile
      pipeline {
          agent none
      
          parameters {
              string(name:'stringParam', defaultValue: null)
              run(name: 'runParam', filter: 'ALL', projectName: 'some-other-job')
          }
          
          stages {
              stage('test') {
                  steps {
                      echo "params.stringParam: ${params.stringParam}"
                      echo "params.runParam: ${params.runParam}"
                      echo "env.runParam: ${env.runParam}"
                  }
              }
          }
      }
      

      Result:

      Started by user unknown or anonymous
      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] stage
      [Pipeline] { (test)
      [Pipeline] echo
      params.stringParam: xx
      [Pipeline] echo
      params.runParam: null
      [Pipeline] echo
      env.runParam: http://xxx/job/some-other-job/4/
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

            oleg_nenashev Oleg Nenashev
            scddev Dietmar Scheidl
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: