title: How to set variables from withCredentials as global variables in Jenkins?
body: <p>I have a scripted pipeline where I would like to take the variables from withCredentials and set them as global variables. I've tried the following and in a bat command if I run &quot;set PASSWORD&quot; it returns</p>
  <p>&quot;USERNAMEx=****&quot;</p>
  <p>&quot;USERNAME=****&quot;</p>
  <p>However, a further step using the Allure plugin fails with:</p>
  <p>&quot;Required property not found: ALLURE_JIRA_USERNAME&quot;</p>
  <p>If I set the values as parameters the environment variables are recognised by the plugin. Ideally I would like to use the withCredentials though.</p>
  <pre><code>withCredentials([usernamePassword(credentialsId: 'dsdsdsdd',
      passwordVariable: 'PASSWORDx',
      usernameVariable: 'USERNAMEx')]) {
  node('master'){
      withEnv([
          PASSWORD = &quot;${PASSWORDx}&quot;,
          USERNAME = &quot;${USERNAMEx}&quot;
      ]) {
  </code></pre>