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

Unusable environment variable TRIGGERED_BUILD_NUMBER_jobname

      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.

          [JENKINS-14545] Unusable environment variable TRIGGERED_BUILD_NUMBER_jobname

          John van der Kamp created issue -
          cjo9900 made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          cjo9900 made changes -
          Assignee Original: huybrechts [ huybrechts ] New: cjo9900 [ cjo9900 ]
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 145230 ] New: JNJira + In-Review [ 191393 ]
          D Pasto made changes -
          Link New: This issue relates to JENKINS-34340 [ JENKINS-34340 ]

            cjo9900 cjo9900
            john John van der Kamp
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: