Syntax check in Script Registry shows mangled script and errors

Description

*This issue has moved*

This issue has been moved permanently to Adaptavist's Product Support JIRA instance.

All existing users of this instance should have the same username on our Product Support instance. However, you will very likely need to click on the
Can't access your account link in order to reset to a new password.

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.

Environment

JIRA 7.0.10

Assignee

Jamie Echlin

Reporter

Ulrich Hobelmann [catworkx]

Labels

None

Internal Complexity

Unknown

Internal Value

Unknown

Affects versions

Priority

Major
Configure