title: Jenkins global variables
body: <p>I'm trying to use global variables within Jenkins on Windows to "automagically" retrieve the proper code base from our SCM system, but in each case that I've tried the variable substitution is not happening.</p>
  
  <p>I've set up some global variables, with default values, within "Configure System" and have tried to access them with <code>$VARIABLE</code>, <code>${VARIABLE}</code> and <code>%VARIABLE%</code> as part of the Branch field for the Surround SCM plugin with no success whatsoever.</p>
  
  <p>I've also installed the Global Variable String Parameter plugin with the same success rate (0%). Using a literal value works just fine, but no type of variable substitution seems to work at all and I'm sure that someone has come upon this before and resolved it.</p>
  
  <p>I've tried searching for something similar to this but nothing really approaches this usage of globals, instead it is normally discussed as a function within an external script, or parameter passed to a batch file, etc.</p>
  
  <p>I've run "set" as the first step and can see that the variable is available, but the substitution is just not happening.  If it means I will have to script something, then so be it, as I am trying to make this extremely flexible and as headache free as possible, but that isn't seeming to be the case in this case thus far.</p>
  
  <p>My problem is eerily similar to this post: <a href="https://stackoverflow.com/questions/8606664/how-are-environment-variables-used-in-jenkins-with-windows-batch-command">How are environment variables used in Jenkins with Windows Batch Command?</a>, but again, I'm not looking to script this as it is a MUCH simpler solution to use the variable values directly.</p>