• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • None
    • Jenkins 2.72 installed via Windows installer on Windows Server 2012
      Pipeline running on linux node: Linux 3.10.0-514.21.2.el7.x86_64
      pipeline-input-step 2.6

      When using the choice parameter, the selection is not being output to the appropriate environment variable. Here is the code I am using:
       

      def environmentChoices = ['blue', 'green'].join('\n') 
      def stagingEnvironmentInpit = input( message: "apistaging.evolution-software.com is currently pointed to ${currentEnvironment}. Where do you want to promote to?", ok: 'Deploy', parameters: [choice(choices: environmentChoices, name: 'RELEASE_ENVIRONMENT')] ) 
       echo env.RELEASE_ENVIRONMENT

       RELEASE_ENVIRONMENT will remain null.

          [JENKINS-46971] Input plugin not setting environment variable

          Gustav Lasko created issue -
          Gustav Lasko made changes -
          Description Original: When using the choice parameter, the selection is not being output to the appropriate environment variable. Here is the code I am using:
           
          {code:java}
          def environmentChoices = ['blue', 'green'].join('\n') def stagingEnvironmentInpit = input( message: "apistaging.evolution-software.com is currently pointed to ${currentEnvironment}. Where do you want to promote to?", ok: 'Deploy', parameters: [choice(choices: environmentChoices, name: 'RELEASE_ENVIRONMENT')] )
           echo env.RELEASE_ENVIRONMENT{code}
           RELEASE_ENVIRONMENT will remain null.
          New: When using the choice parameter, the selection is not being output to the appropriate environment variable. Here is the code I am using:
            
          {code:java}
          def environmentChoices = ['blue', 'green'].join('\n')
          def stagingEnvironmentInpit = input( message: "apistaging.evolution-software.com is currently pointed to ${currentEnvironment}. Where do you want to promote to?", ok: 'Deploy', parameters: [choice(choices: environmentChoices, name: 'RELEASE_ENVIRONMENT')] )
           echo env.RELEASE_ENVIRONMENT{code}
           RELEASE_ENVIRONMENT will remain null.

          Andrew Bayer added a comment -

          input can't automatically propagate to the environment - you can find the input result, in your case, in stagingEnvironmentInput. If you had multiple parameters, you could find it in stagingEnvironmentInput.RELEASE_ENVIRONMENT.

          Andrew Bayer added a comment - input can't automatically propagate to the environment - you can find the input result, in your case, in stagingEnvironmentInput . If you had multiple parameters, you could find it in stagingEnvironmentInput.RELEASE_ENVIRONMENT .
          Andrew Bayer made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            Unassigned Unassigned
            glasko Gustav Lasko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: