Unusable environment variable TRIGGERED_BUILD_NUMBER_jobname

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The plugin exports two environment variables named TRIGGERED_BUILD_NUMBER_<jobname>=<buildnumber>. However, if your job has characters outside the alphanumeric range, the variable exported is unusable. Example: my job is named project-builder, then the exported variable will be TRIGGERED_BUILD_NUMBER_project-builder=123. Because of the - character, this variable is unusable. ${TRIGGERED_BUILD_NUMBER_project-builder} does not work.

      The copy artifact plugin does a sanitation of the project name in the same export like this for it's COPYARTIFACT_BUILD_NUMBER_jobname environment var:

      projectName.toUpperCase().replaceAll("[^A-Z]+", "_")
      

      I think the the regex can be extended with 0-9 as valid characters too actually, but this would be the fix for this problem too.

            Assignee:
            cjo9900
            Reporter:
            John van der Kamp
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: