Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-35253

Whitelist Groovy capitalize method from String for sandbox

XMLWordPrintable

      I get the following error when trying to pipeline build:

      org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods capitalize java.lang.String

      It's triggered by the code in my pipeline definition:

      def branchToBuild = "${env.JOB_NAME}".tokenize('-').last()
      def dockerTaskBranch = branchToBuild.capitalize()

      The capitalize method should be safe enough to call from the sandbox

            vjuranek vjuranek
            netroworx Greg Pagendam-Turner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: