Interview Prep/Jenkins/Jenkinsfile syntax, Groovy & CPS errors

`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).

All Jenkins questions Roadmap: Jenkins

More on Jenkinsfile syntax, Groovy & CPS errors