I know you can get NODE_NAME from the current build using
env.NODE_NAME
But when I tried to figure out the build machine from the previous build
Jenkins.instance.getItemByFullName('jobname').lastSuccessfulBuild.getEnvironment()
The result doesn't contain the NODE_NAME which I need. Is there another way to find out the NODE_NAME?