-
Bug
-
Resolution: Unresolved
-
Critical
-
None
Feel free to adjust the subject if you find better wording, what happens is:
pipeline { agent any stages { stage ('This will work') { steps { script { def jobs = Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.job.WorkflowJob) println "Found ${jobs.size()} jobs" } } } stage ('This will also work') { steps { script { bat "dir" } } } stage ('This will fail') { steps { script { def jobs = Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.job.WorkflowJob) println "Found ${jobs.size()} jobs" bat "dir" } } } } }