I get the same result on 4.2.c. This does not appear to have anything to do with the web script…the same thing happens through a regular server-side JavaScript execution of the code. Have you checked Jira to see if this is a known issue? If not, it's going to need to be debugged and possibly reported as a bug.