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

Job parameters allows duplicates

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core

      Creating a pipeline script with a parameters declaration that declares copies of an exact same parameter seem to work. The code block below in a jenkins pipeline would update the job with three parameters all of the name TAG. This seems like unexpected behavior. I would have expected Jenkins to error with an exception?

      properties([
          parameters([
              string(name: 'TAG', description: 'git tag to merge to master'),
              string(name: 'TAG', description: 'git tag to merge to master'),
              string(name: 'TAG', description: 'git tag to merge to master')
          ])
      ])
      
      stage('TEST') {
          if (params.TAG == null || params.TAG.trim().isEmpty()) {
              error('TAG must be specified')
          }
      }

            Unassigned Unassigned
            yanger312 Andrew Yang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: