1

Within a Jenkinsfile in a multi-branch pipeline I'm trying to convert an array to a set to get unique elements but I always get

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException

with nothing present in the script approval page (/scriptApproval). I've tried:

def set = myArray.toSet()
def set = new HashSet(myArray)

but both give the RejectedAccessException. How can I accomplish finding unique elements in an array in Jenkins pipeline code?

Friedrich 'Fred' Clausen
  • 3,321
  • 8
  • 39
  • 70
  • How myArray is initialized? – Vitalii Vitrenko Jul 16 '17 at 20:51
  • Possible duplicate of [Jenkins CI Pipeline Scripts not permitted to use method groovy.lang.GroovyObject](https://stackoverflow.com/questions/38276341/jenkins-ci-pipeline-scripts-not-permitted-to-use-method-groovy-lang-groovyobject) – acm Jan 02 '18 at 13:02

0 Answers0