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?