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

Advice about how to recover input step parameters

XMLWordPrintable

      Snippet generator is a great tool that helps developers to create new Pipelines.

      As when a parameterized input step is generated at snippet generator without mention of how to recover them, it'd be great if snippet it self can provide the example.

      If it not possible, at least the help should provide an example, not only _ If multiple parameters are listed, the return value will be a map keyed by the parameter names._ as currently.

      https://github.com/jenkinsci/workflow-plugin/blob/118b89e1b1828a39f50fb955942ffcbbe69e653e/support/src/main/resources/org/jenkinsci/plugins/workflow/support/steps/input/InputStep/help.html

      https://github.com/jenkinsci/workflow-plugin/blob/118b89e1b1828a39f50fb955942ffcbbe69e653e/support/src/main/resources/org/jenkinsci/plugins/workflow/support/steps/input/InputStep/help-parameters.html

      For example:

      def inputParameter = input message: 'One Parameter', parameters: [[$class: 'StringParameterDefinition', defaultValue: '', description: '', name: 'inputParameter']]
      
      def inputParameterMap =  input message: 'Two Parameters', parameters: [[$class: 'StringParameterDefinition', defaultValue: '', description: '', name: 'one'], [$class: 'StringParameterDefinition', defaultValue: '', description: '', name: 'two']]
      def inputParameterOne = inputParameterMap['one']
      def inputParameterTwo = inputParameterMap['two']
      

            escoem Emilio Escobar
            escoem Emilio Escobar
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: