title: Jenkinsfile - get parent path in environment block
body: <p>I need to get the parent directory of the current WORKSPACE and set the value to the environment variable.
  I tried the following:</p>
  <pre><code>pipeline {
  
      agent {
          label 'test'
      }
      
      environment{
          COMMON = &quot;${Paths.get(env.WORKSPACE).getParent()}&quot;
      }
      
      stages { ... }
  </code></pre>
  <p>But when I run it I get the following exception <code>java.lang.IllegalArgumentException: One or more variables have some issues with their values: COMMON</code>.</p>
  <p>I have a solution as a last resort -&gt; run <code>powershell/bash</code> script as the first stage and calculate the path there. But in this case, the step will be displayed on UI, which is undesired.
  Any thoughts about how to calculate the parent directory value directly in the environment block?</p>