I'm performing a test upgrade of an old JIRA instance to 7.0 and going through all Groovy scripts in the process.
The Script Registry worked nicely for finding scripts with problems, but there are some workflow scripts that:
- are correct (when edited from JIRA's workflow editor for conditions or post-functions)
- are shown mangled in the Script Registry
- (probably bc. of the mangled code) are shown as having errors in the Script Registry
For instance: the following code line:
text = "<tr><td>EO</td><td>$userName</td><td>am $now</td></tr>\n"
is shown as the following in the script registry (but not in the actual workflow):
text = "EO$userNameam $now\n"
with the error message:
[Static type checking] - The variable [userNameam] is undeclared.
It looks like there is some HTML stripping going on (instead of only escaping it for including it in the textarea), and like the syntax checks happen after the code is already stripped.