diff --git a/vars/analysis.groovy b/vars/analysis.groovy
index ed119670fa67468dc8116472aa16559da6a9d871..0bf8122fa19dd7911a185b7cd097134a328d9084 100644
--- a/vars/analysis.groovy
+++ b/vars/analysis.groovy
@@ -9,10 +9,10 @@
 // This is the function called from the .jenkinsfile
 def call() {
   def builds = []
+  def parentJob = env.JOB_NAME[0..-10]     // remove "-analysis" from the job name, which is 9 chars long
 
   // Run for all -Debug builds of the main job
   script {
-    def parentJob = env.JOB_NAME[0..-10]     // remove "-analysis" from the job name, which is 9 chars long
     node('Docker') {
       copyArtifacts filter: "builds.txt", fingerprintArtifacts: true, projectName: parentJob, selector: lastSuccessful(), target: "artefacts"
       myFile = readFile(env.WORKSPACE+"/artefacts/builds.txt")