`Scripts not permitted to use method org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper getRawBuild`
IntermediateTroubleshootingJenkinsfile syntax, Groovy & CPS errors
Answer
Likely causes → Pipeline calls currentBuild.rawBuild to access the internal Run object, which is blocked by the sandbox.
Diagnose → Search for rawBuild usage.
Fix → Use the safe RunWrapper API: currentBuild.getBuildCauses(), currentBuild.changeSets, currentBuild.previousBuild.result. Do not approve getRawBuild; it exposes the full internal API.
Prevent → Provide library steps for common needs (causes, changes, previous result).
More on Jenkinsfile syntax, Groovy & CPS errors
`WorkflowScript: 1: Missing required section "agent" @ line 1, column 1.`Beginner`Unknown stage section "step". Starting with version 0.5, steps in a stage must be in a ‘steps’ block.`Beginner`java.lang.NoSuchMethodError: No such DSL method 'withSonarQubeEnv' found among steps [archive, bat, build, ...]`Beginner`java.io.NotSerializableException: java.util.regex.Matcher`Advanced`java.io.NotSerializableException: groovy.json.internal.LazyMap`Intermediate`org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object`Intermediate