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

Workflow Snippet Generator - Incorrect format for Input with Choice Parameter

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core

      Snippet generator generates an array:

      input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: ['Red', 'Blue', 'Green'], description: '', name: 'env']]
      

      ChoiceParameterDefinition requires a delimited string.

      Workaround by modifying the snippet code by converting array to string with "\n" separator, e.g.:

      input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: 'Red\nBlue\nGreen', description: '', name: 'env']]
      
      

      Or just join the Array elements:

      input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: ['Red', 'Blue', 'Green'].join('\n'), description: '', name: 'env']]
      

          [JENKINS-26143] Workflow Snippet Generator - Incorrect format for Input with Choice Parameter

          Nigel Harniman created issue -
          Jesse Glick made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: workflow-plugin [ 18820 ]
          Assignee Original: Jesse Glick [ jglick ]
          Labels New: workflow
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-26093 [ JENKINS-26093 ]
          Jesse Glick made changes -
          Link Original: This issue is related to JENKINS-26093 [ JENKINS-26093 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-26619 [ JENKINS-26619 ]
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-27901 [ JENKINS-27901 ]
          Antonio Muñiz made changes -
          Link New: This issue is duplicated by JENKINS-34590 [ JENKINS-34590 ]
          Jesse Glick made changes -
          Epic Link New: JENKINS-35393 [ 171186 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 160133 ] New: JNJira + In-Review [ 180266 ]
          Andrew Bayer made changes -
          Labels Original: workflow New: pipeline workflow
          Andrew Bayer made changes -
          Labels Original: pipeline workflow New: pipeline

            danielbeck Daniel Beck
            nharniman Nigel Harniman
            Votes:
            38 Vote for this issue
            Watchers:
            43 Start watching this issue

              Created:
              Updated:
              Resolved: