title: How to list the jenkins jobs script path programmatically
body: <p>I'd like to create a groovy script to run on the jenkins console to list the job definition with the repository used and the script path (the jenkinsfile), with an output like this:</p>
  
  <p>JobName -> git repository -> script path</p>
  
  <p>So far I was able to list the job name and the git repository, but I can't find a way to get the script path. It doesn't seem contained in the GitSCM plugin, but I can't find a way to obtain it through the WorkflowJob. This is my current code:</p>
  
  <pre><code>Jenkins.instance.getAllItems(Job.class).each{
    jobName = it.getName()
    if(it instanceof FreeStyleProject){
     return
    }
    scm = it.getTypicalSCM();
    if (scm instanceof hudson.plugins.git.GitSCM) {
      scm.getRepositories().each{
          it.getURIs().each{
              println(jobName +"-&gt; "+ it.toString());
          }
      }
    }
  }
  </code></pre>
  
  <p>How can I retrieve the script path?</p>