groovy.lang.MissingPropertyException: No such property: manager for class: Script1
manager
is provided by certain Groovy script plugins, but not all. To make your script generic, use the Jenkins/Hudson API instead:
import hudson.model.*
def build = Thread.currentThread().executable
def buildNumber = build.number
...
Just in case it helps, if you are using the 'Execute System Groovy Script', you don't need to use the 'manager' variable. This worked for me -
def workspace = build.getEnvVars()["WORKSPACE"]
One of the reasons groovy.lang.MissingPropertyException: is thrown when you are using a variable outside of its scope or you haven't defined that variable.