title: How to escape Jenkins parameterized build variables
body: <p>I use <code>Jenkins ver. 1.522</code> and I want to pass a long string with spaces and quotes as a parameter in the parameterized build section. The job only runs a python script.</p>
  
  <p>My problem is that I can't find a way to escape my string so that jenkins passes it correctly to the script.</p>
  
  <p>Assuming...</p>
  
  <p>string: <code>fixVersion in ("foo") AND issuetype in (Bug, Improvement) AND resolution = Fixed ORDER BY resolution ASC, assignee ASC, key DESC</code></p>
  
  <p>variable name: bar</p>
  
  <p>script name: coco.py</p>
  
  <p>When I run the script in the terminal, everything is fine: <code>python coco.py --option 'fixVersion in ("foo") AND issuetype in (Bug, Improvement) AND resolution = Fixed ORDER BY resolution ASC, assignee ASC, key DESC'</code></p>
  
  <p>When I run the same script with jenkins using the parametrized build and try to escape the variable so it end up taken as one parameter by the py script it is oddly espacped by jenkins.</p>
  
  <p>In my jenkins job I call the script: <code>python coco.py --option \'${BAR}\'</code> </p>
  
  <p>and it ends up as:</p>
  
  <p><code>python coco.py --option '"fixVersion' in '('\''foo'\'')' AND issuetype in '(Bug,' 'Improvement)' in '(Production,' 'Stage)' AND resolution = Fixed ORDER BY resolution ASC, assignee ASC, key 'DESC"'</code></p>
  
  <p>I also tried <code>\"${BAR}\"</code>, <code>\"$BAR\"</code>,<code>\'$BAR\'</code></p>
  
  <p>What it the right way do acheive it?</p>