title: Counter variable not incrementing when accessing it in Groovy JSR223 Sampler
body: <p>I have a simple loop controller and within it, a Counter config element, and a JSR223 Sampler running Groovy code. My Counter is set to begin at 0, increment by 1 up to a max of 3, and is set to a variable named 'idx'.</p>
  
  <p>In my JSR223 Sampler, I log the value of idx using <code>log.info(${idx});</code> -- it always prints the first iteration value (in my case 0), for every loop iteration.</p>
  
  <p>I disabled this JSR223 sampler and added a BeanShell sampler, doing the same log statement, <code>log.info(${idx});</code>, and it is incrementing properly -- I get the values 0, 1, 2 for the iteration.</p>
  
  <p>I need to take some JSON, map them to objects, do some tweaking, then map them back to JSON. There are JSONParser, JSONObject, and JSONArray classes that seem to be working in the BeanShell Sampler, but I'm much more comfortable with Groovy's JsonSlurper and JsonBuilder classes and would prefer to use these.</p>
  
  <p>All of these steps are within a Test Fragment, if that makes a difference. Anyone have any ideas? Is this a bug?</p>