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

Unusable environment variable TRIGGERED_BUILD_NUMBER_jobname

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              cjo9900 cjo9900
              Reporter:
              john John van der Kamp
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: