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

Workflow Snippet Generator - Incorrect format for Input with Choice Parameter

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
    • Similar Issues:

      Description

      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']]
      

        Attachments

          Issue Links

            Activity

            nharniman Nigel Harniman created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Labels workflow
            Assignee Jesse Glick [ jglick ]
            Component/s core [ 15593 ]
            Component/s workflow-plugin [ 18820 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-26093 [ JENKINS-26093 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-26093 [ JENKINS-26093 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-26619 [ JENKINS-26619 ]
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-27901 [ JENKINS-27901 ]
            amuniz Antonio Muñiz made changes -
            Link This issue is duplicated by JENKINS-34590 [ JENKINS-34590 ]
            jglick Jesse Glick made changes -
            Epic Link JENKINS-35393 [ 171186 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 160133 ] JNJira + In-Review [ 180266 ]
            abayer Andrew Bayer made changes -
            Labels workflow pipeline workflow
            abayer Andrew Bayer made changes -
            Labels pipeline workflow pipeline
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-38995 [ JENKINS-38995 ]
            bitwiseman Liam Newman made changes -
            Link This issue relates to JENKINS-41180 [ JENKINS-41180 ]
            bitwiseman Liam Newman made changes -
            Link This issue relates to JENKINS-40358 [ JENKINS-40358 ]
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue is related to JENKINS-38913 [ JENKINS-38913 ]
            medianick Nick Jones made changes -
            Description 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 delimted string.

            Workaround by modifying the snippet code by converting array to string with "\n" separator. ie

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

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

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

            {code:java}
            input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: 'Red\nBlue\nGreen', description: '', name: 'env']]
            {code}
            burtsevyg Yuriy Burtsev made changes -
            Assignee Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Assignee Jesse Glick [ jglick ]
            danielbeck Daniel Beck made changes -
            Link This issue is duplicated by JENKINS-33271 [ JENKINS-33271 ]
            danielbeck Daniel Beck made changes -
            Remote Link This issue links to "PR 3014 (Web Link)" [ 17655 ]
            jglick Jesse Glick made changes -
            Assignee Daniel Beck [ danielbeck ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            danielbeck Daniel Beck made changes -
            Status In Review [ 10005 ] In Progress [ 3 ]
            danielbeck Daniel Beck made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            danielbeck Daniel Beck made changes -
            Remote Link This issue links to "workflow-multibranch PR 72 (tests) (Web Link)" [ 20249 ]
            danielbeck Daniel Beck made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            rodrigc Craig Rodrigues made changes -
            Link This issue is related to JENKINS-41180 [ JENKINS-41180 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-53917 [ JENKINS-53917 ]
            voorth voorth made changes -
            Description Snippet generator generates an array:

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

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

            {code:java}
            input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: 'Red\nBlue\nGreen', description: '', name: 'env']]
            {code}
            Snippet generator generates an array:
            {code:java}
            input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: ['Red', 'Blue', 'Green'], description: '', name: 'env']]
            {code}
            ChoiceParameterDefinition requires a delimited string.

            Workaround by modifying the snippet code by converting array to string with "\n" separator, e.g.:
            {code:java}
            input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: 'Red\nBlue\nGreen', description: '', name: 'env']]

            {code}
            Or just join the Array elements:
            {code:java}
            input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: ['Red', 'Blue', 'Green'].join('\n'), description: '', name: 'env']]
            {code}
             
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-44892 [ JENKINS-44892 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-61438 [ JENKINS-61438 ]
            nfalco Nikolas Falco made changes -
            Link This issue causes JENKINS-61438 [ JENKINS-61438 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: