The behaviour is correct the default env variables that the promotion job sees are the one for its own runs (as it a job/project in itself).
However it provides a different set of env variables, so that you can get at job being promoted, these are PROMOTED_URL - URL of the job being promoted ex: http://jenkins/job/job_name_being_promoted/77/ PROMOTED_JOB_NAME - Promoted job name ex: job_name_being_promoted PROMOTED_NUMBER - Build number of the promoted job ex: 77 PROMOTED_ID - ID of the build being promoted ex: 2012-04-12_17-13-03 As copied from the wiki page https://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin Chris On Wednesday, June 27, 2012 7:08:43 PM UTC+1, Nicky Ramone wrote: > > It still behaves strangely. It doesn't seem to resolve variables. > > On Wed, Jun 27, 2012 at 2:45 PM, Nicky Ramone <nixe...@gmail.com> wrote: > >> Looks like it does pick environment variables, but the BUILD_NUMBER being >> picked is the one that corresponds to the promotion #. >> Is there a way of obtaining the number of the build being promoted? >> >> >> On Wed, Jun 27, 2012 at 2:32 PM, Nicky Ramone <nixe...@gmail.com> wrote: >> >>> Hi >>> >>> It would be useful if we could use environment variables when specifying >>> the "Properties File Path". >>> When doing a promotion, I am currently trying to load a properties file >>> that exists in the archived artifacts of that build. So, I >>> used: ../builds/$BUILD_NUMBER/archive/my.properties >>> Unfortunately, the Envinject plugin does not seem to be resolving the >>> BUILD_NUMBER variable. >>> >>> Is this correct? Any ideas? >>> >>> Thanks. >>> Regards >>> >> >> >