title: Jenkins array variable in environment tag/body
body: <p>I would like to define an array of strings within the environment tag/body of the Jenkins pipeline. This doesn't seem to work; jenkins doesn't recognize the array.</p>
  
  <p>Environment variable values must either be single quoted, double quoted, or function calls. @ line x, column y.
          myArray= [</p>
  
  <pre><code>pipeline {
      agent {
          label 'Test'
      }
  
      environment {
          myArray = [
              "Item1",
              "Item2",
              "Item3"
          ]
      }
  }
  </code></pre>
  
  <p>The next code seems to work, but I would like to have all fields/ settings in the environment tag.</p>
  
  <pre><code>def myArray = [
              "Item1",
              "Item2",
              "Item3"
          ]
  
  pipeline {
      agent {
          label 'Test'
      }
  
      environment {
      }
  }
  </code></pre>