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

Input plugin not setting environment variable

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Not A Defect
    • 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

    Description

      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.

      Attachments

        Activity

          glasko Gustav Lasko created issue -
          glasko Gustav Lasko made changes -
          Field Original Value New Value
          Description 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.
          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.
          abayer Andrew Bayer made changes -
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Resolved [ 5 ]

          People

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

            Dates

              Created:
              Updated:
              Resolved: