title: How can I use a bamboo plan variable in a script task?
body: <p>I have defined in my bamboo plan a variable (<code>BAMBOO_TEST_VAR</code>) that I'd like to reuse in a particular script but I can't seem to figure out how to make it visible to that script.</p>
  <p><a href="https://i.stack.imgur.com/W5PUi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W5PUi.png" alt="Bamboo Plan Variables Configuration" /></a></p>
  <p>If I just reference that variable from the script it merely prints the variable as empty.</p>
  <pre><code>27-Oct-2020 23:34:00    TEST JOB
  27-Oct-2020 23:34:00    bamboo.shortJobName = 
  27-Oct-2020 23:34:00    BAMBOO_TEST_VAR=
  </code></pre>
  <p><a href="https://i.stack.imgur.com/eh1Xy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eh1Xy.png" alt="Bamboo Script Configuration" /></a></p>
  <p>And if I provide it as input to the <code>Environment variables</code> field it just renders with the value I give in that field taken as a literal, not to the plan variable I was hoping it would evaluate to.</p>
  <pre><code>27-Oct-2020 23:36:57    TEST JOB
  27-Oct-2020 23:36:57    bamboo.shortJobName = 
  27-Oct-2020 23:36:57    BAMBOO_TEST_VAR=$BAMBOO_TEST_VAR
  </code></pre>
  <p><a href="https://i.stack.imgur.com/pr3jJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pr3jJ.png" alt="Configuring from Environment variables field" /></a></p>
  <p>How can I reference the plan's environment variable directly from a script task without passing it down through arguments or something of the sort. What aspect or bamboo detail am I ignorant of that would have informed me that what I'm attempting is not possible or not supported because of reason XYZ?</p>