title: How to get the folder name in which Jenkins pipeline job is running
body: <p>I am writing a JenkinsFile for pipeline to pass few variables from the pipeline to a downstream freestyle job. I need the value of the folder name in which my pipeline is.</p>
  
  <p>I have checked the Ownership plugin(<a href="https://wiki.jenkins.io/display/JENKINS/Ownership+Plugin" rel="nofollow noreferrer">https://wiki.jenkins.io/display/JENKINS/Ownership+Plugin</a>). This provides information only about job and node ownership. </p>
  
  <p>I've done following for job ownership details</p>
  
  <pre><code>println "Primary owner ID: ${ownership.job.primaryOwnerId}"
  println "Primary owner e-mail: ${ownership.job.primaryOwnerEmail}"
  </code></pre>
  
  <p>I want something similar for <b>folder ownership</b> in JenkinsFile that I am writing. I also tried finding some environment variables that can give this value but couldn't find any.</p>
  
  <p>Any help via some plugin methods(as used for job owner) or some environment variable will be appreciated.</p>