I want to force following scenario in Jenkins:
I ran into the same problem "unable to resolve class jenkins.model.Jenkins" as commented by @iloveretards, until I realized I had tried to use the build step "Execute Groovy script". After switching to build step "Execute system Groovy script", this actually worked as intended:
import jenkins.model.Jenkins
Jenkins.instance.getItem("job-name").disable()