title: How to put JOB_NAME excluding folder into an environment variable in Jenkins?
body: <p>I want to put the name of the currently executing Jenkins job into an environment variable for use later in my pipeline, without the folder name. I'm assuming I need something like :</p>
  
  <pre><code>withEnv(['JOB_BASE_NAME=JOB_NAME.split('/').last()']) {
      echo "Job base name: ${JOB_BASE_NAME}"
  }
  </code></pre>
  
  <p>but I get an error:</p>
  
  <pre><code>org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: 
      unclassified method java.lang.String div java.lang.String
  </code></pre>