5

I'm using a Freestyle project / job with a Process Job DSLs build step as provided by the Jenkins Job DSL plugin, i.e. that is the "seed" job. How can I, from within the code provided by Use the provided DSL script, get the seed job's name?

I've tried to apply the answers to this question but none of them worked.

Community
  • 1
  • 1
sschuberth
  • 28,386
  • 6
  • 101
  • 146

1 Answers1

12

All build variables are injected into the DSL scripts, see Access the Jenkins Environment Variables. The JOB_NAME variable contains the name of the seed job.

println JOB_NAME
daspilker
  • 8,154
  • 1
  • 35
  • 49
  • Thanks, but why do I need to access the executor / build for that? The name is statically defined in the job / project configuration, so I should be able to access it from there, or? – sschuberth Sep 16 '15 at 15:53