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

Global variables are overriding local variables

    XMLWordPrintable

Details

    • Task
    • Status: In Review (View Workflow)
    • Blocker
    • Resolution: Unresolved
    • workflow-job-plugin
    • None
    • Jenkins 2.138.2 and 2.138.3

    Description

      We had this issue since 2.138.2, now we are on 2.138.3

      When running a build, its always ignoring the local parameters and its always taking into consideration only the global parameters. This makes it impossible for us to run builds with different parameters as they will always only follow the global parameters.

       

      The only way this could work is when there is no global parameters. If there is only Local parameters then they wont be overriden.

      Attachments

        Issue Links

          Activity

            heiko_nardmann Heiko Nardmann added a comment - - edited

            To me it looks like this issue is still unresolved in 2021.

            And I see it in a freestyle job where I redefine an environment variable (using "Prepare an environment for the run") that is initially defined globally. Only the global value is seen in my "Execute shell" step.

             

            Jenkins v2.204.6

            heiko_nardmann Heiko Nardmann added a comment - - edited To me it looks like this issue is still unresolved in 2021. And I see it in a freestyle job where I redefine an environment variable (using "Prepare an environment for the run") that is initially defined globally. Only the global value is seen in my "Execute shell" step.   Jenkins v2.204.6
            wreggyl Jan Bottek added a comment -

            Hi, i tested it again with Jenkins 2.164.2 and the plugins

             

            PlugIn from
            Pipeline: Declarative 1.3.7
            Pipeline: Declarative Extension Points API 1.3.7
            Pipeline: Job  2.32

            We have a global environment variable in Jenkins and a Job with a parameter with the same name and we try to overwrite the resulting env variable in the job

             

            node()

            {     echo env.custom_env_var     echo params.custom_env_var }

            In FreeStyle Job this is still working, only in pipeline we get this error.

            wreggyl Jan Bottek added a comment - Hi, i tested it again with Jenkins 2.164.2 and the plugins   PlugIn from Pipeline: Declarative 1.3.7 Pipeline: Declarative Extension Points API 1.3.7 Pipeline: Job  2.32 We have a global environment variable in Jenkins and a Job with a parameter with the same name and we try to overwrite the resulting env variable in the job   node() {     echo env.custom_env_var     echo params.custom_env_var } In FreeStyle Job this is still working, only in pipeline we get this error.
            wreggyl Jan Bottek added a comment - - edited

            fhajredini thx for the fast replay. sorry for my question, but how can i see now in which version of the plugin this issue is solved? because issue is still open and on your mentioned CI i didn't see the code for the plugin itself, or what i overlook?

             

            => ahh, now i understood

            wreggyl Jan Bottek added a comment - - edited fhajredini thx for the fast replay. sorry for my question, but how can i see now in which version of the plugin this issue is solved? because issue is still open and on your mentioned CI i didn't see the code for the plugin itself, or what i overlook?   => ahh, now i understood

            We have added a helper function where we get the environment data. You can check our Jenkins CI/CD on https://github.com/pelagicore/pelux-manifests.git

            fhajredini fisnik hajredini added a comment - We have added a helper function where we get the environment data. You can check our Jenkins CI/CD on https://github.com/pelagicore/pelux-manifests.git
            wreggyl Jan Bottek added a comment -

            is there any progress on this issue, or something which can be done from my site to help solving this issue?

            wreggyl Jan Bottek added a comment - is there any progress on this issue, or something which can be done from my site to help solving this issue?

            People

              Unassigned Unassigned
              fhajredini fisnik hajredini
              Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated: