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

Parameters with the same name as ENV variables overwrite the existing ENV variables

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • core
    • None

      When you have an existing ENV variable and then have a build with a parameter of the same name(even if different case) it will overwrite the ENV variable.

      Reproduction case:

      Create a global ENV variable called "FOO" and set it to "BAR"

      Create a test job "TestJob"

      Add a string parameter called "foo" to the job

      create a shell step to echo out the value of $FOO

      Run the job with TEST as the value of foo

      Observe that the output of the shell step is "TEST" instead of "BAR"

       

      Resolution:

      Personally I think freestyle jobs should call out if you want an ENV or parameter much like pipeline scripts do with the $param.VARIABLE. This will avoid the confusion entirely.

            Unassigned Unassigned
            ataylor Alex Taylor
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: