In the original jython plugin, the script was running inside the master jvm and it was thus possible to access Hudson internals, like this:
hudson = hudson.model.Hudson.getInstance()
In jenkins this still works perfectly when downgrading the plugin to version 1.3, with the minor change below:
hudson = jenkins.model.Jenkins.getInstance()
In version 1.4 the plugin was changed to execute the script in an external jvm, so Jenkins internals can no longer be accessed.
I think the only good reason for having a Jython plugin, is to access Jenkins internals. If you can't do that, you might as well use a regular shell step. and start the jython interpreter yourself, which is a lot more flexible than using the plugin.
Please provide an option to run the interpreter in the Jenkins master jvm (In my opinion this should be the default). If you want to get fancy, there shold be a check preventing setting the job to run on another node.
I know this was a long time on the way, but I have had to use Hudson at work, and this still works in Hudson.
Question: Why cant I pin the plugin version? The pin option only shows up for some plugins.