title: Jenkins Workflow Error When Accessing Variable Inside a Closure
body: <p>I'm using some groovy inside a Jenkins Workflow script that includes a closure.</p>
  
  <pre><code>def newMarkup = new StreamingMarkupBuilder().bind {
     mkp.yield(xml)
  }.toString()
  </code></pre>
  
  <p>As I understand it <code>mkp</code> should be a variable made available inside closures when using <code>StreamMarkupBuilder</code>, however when I try and run this I get the error,</p>
  
  <pre><code>groovy.lang.MissingPropertyException: No such property: mkp for class: WorkflowScript
  </code></pre>
  
  <p>So my question is why doesn't Jenkins recognise that <code>mkp</code> is a property of the <code>StreamMarkupBuilder</code> class and not the workflow script?</p>