title: What are some techniques to avoid script approvals with a Jenkins workflow Groovy script?
body: <p>The following script for the Jenkins Workflow plugin:</p>
  
  <pre><code>def mapping = readFile 'a file'
  mapping.eachLine {
        def line = it.tokenize('|')
        sh "${line[1]}"
  }
  </code></pre>
  
  <p>requires script approvals:</p>
  
  <pre><code>staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods tokenize java.lang.String java.lang.String
  staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods eachLine java.lang.String java.lang.String
  </code></pre>
  
  <p>In order to have the script run successfully a build must be attempted, a manual approval must be granted, and then another build must be attempted again, and so on.</p>
  
  <p>For large scripts it is a rather tedious process to keep white listing methods. </p>
  
  <p>Is there a subset of groovy methods which do not require script approval and/or white listing?</p>