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

Parameters in pipeline are acessible outside the params object

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • pipeline
    • None
    • Jenkins ver. 2.121.3

      Parameters are accessible outside the params object, this is potentially harmful.

      properties([
          parameters([string(defaultValue: 'foo', description: '', name: 'VERSION', trim: false)])
      ])node () {
          echo params.VERSION
          echo VERSION
          echo env.VERSION
          echo vErSiOn
          echo env.VerSiOn
      }
      

      Result

      [Pipeline] {
      [Pipeline] echo
      foo
      [Pipeline] echo
      foo
      [Pipeline] echo
      foo
      [Pipeline] echo
      foo
      [Pipeline] echo
      foo
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      

      It should only work for params.VERSION and return null in the other case.

            Unassigned Unassigned
            hugo_ hugo charles
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: