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

"choice" parameter should take array for choices argument

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • pipeline:2.4
      pipeline-model-definition-plugin:0.8.1

      This is what I have to do now:

      pipeline {
          agent any
          parameters {
              choice(
                  // choices must be newline separated
                  choices: 'greeting\nsilence',
                  description: '',
                  name: 'REQUESTED_ACTION')
          }
      }
      

      This is what I should be able to do:

      pipeline {
          agent any
          parameters {
              choice(
                  choices: ['greeting','silence'],
                  description: '',
                  name: 'REQUESTED_ACTION')
          }
      }
      

          [JENKINS-41180] "choice" parameter should take array for choices argument

          Liam Newman created issue -
          Liam Newman made changes -
          Link New: This issue relates to JENKINS-40358 [ JENKINS-40358 ]
          Liam Newman made changes -
          Description Original: This is what I have to do now:
          {code:groovy}
          pipeline {
              agent any
              parameters {
                  choice(
                      // choices must be newline separated
                      choices: 'greeting\nsilence',
                      description: '',
                      name: 'REQUESTED_ACTION')
              }
          }
          {code}

          This is what I should be able to do:
          {code:groovy}
          pipeline {
              agent any
              parameters {
                  choice(
                      choices: ['greeting','silence'],
                      description: '',
                      name: 'REQUESTED_ACTION')
              }
          }
          {code}
          New: This is what I have to do now:
          {code}
          pipeline {
              agent any
              parameters {
                  choice(
                      // choices must be newline separated
                      choices: 'greeting\nsilence',
                      description: '',
                      name: 'REQUESTED_ACTION')
              }
          }
          {code}

          This is what I should be able to do:
          {code}
          pipeline {
              agent any
              parameters {
                  choice(
                      choices: ['greeting','silence'],
                      description: '',
                      name: 'REQUESTED_ACTION')
              }
          }
          {code}
          Liam Newman made changes -
          Link New: This issue relates to JENKINS-26143 [ JENKINS-26143 ]

          Andrew Bayer added a comment -

          This isn't Declarative-specific, so moving it out of the component.

          Andrew Bayer added a comment - This isn't Declarative-specific, so moving it out of the component.
          Andrew Bayer made changes -
          Component/s Original: pipeline-model-definition-plugin [ 21706 ]
          Assignee Original: Andrew Bayer [ abayer ]
          Andrew Bayer made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: pipeline [ 21692 ]
          Craig Rodrigues made changes -
          Assignee New: Daniel Beck [ danielbeck ]

          Craig Rodrigues added a comment - Fixed in  https://github.com/jenkinsci/jenkins/commit/6de571632c3873689981c27902ae8269fdf094eb
          Craig Rodrigues made changes -
          Link New: This issue is related to JENKINS-26143 [ JENKINS-26143 ]
          Craig Rodrigues made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Fixed but Unreleased [ 10203 ]

            danielbeck Daniel Beck
            bitwiseman Liam Newman
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: