Interview Prep/CI/CD/Jenkins Credentials, Plugins and Controller Issues

`No such property: env for class: groovy.lang.Binding` in a shared library.

AdvancedTroubleshootingJenkins Credentials, Plugins and Controller Issues
Answer

Likely causes → Accessing pipeline globals from a class in src/ without passing the script context.

Diagnose → Check where env is used.

Fix → Pass this (steps) into the class constructor and use steps.env, steps.sh.

Prevent → Keep step calls in vars/ and pure logic in src/.

All CI/CD questions

More on Jenkins Credentials, Plugins and Controller Issues