If an inline script that you have written throws an error and produces a stack trace (which will most likely be visible in the application logs, if not directly in the UI), here are some steps you can take to work out which one it is.
Some scripted items will decorate their stack traces to include basic identifying information at the beginning: for example, scripted fields will provide the field name, as well as the key of the issue that they were being evaluated on when the error occurred. It is worth checking the logs for any such information first before proceeding with the below steps.
- Look for a line in the stack trace that refers to
ScriptXXX.groovy, where XXX is a number.
- On the server where the Jira home directory is located, enter that directory and then navigate from there to the
scriptrunner/classes, locate the file
ScriptXXX.class, where XXX is the same number you identified in step 1.
- Take a copy of that
.classfile and decompile it. Many Java IDEs have this functionality built in, or you can use an online service such as javadecompilers.com.
- Compare the decompiled file with the inline scripts you have configured on your instance of Jira to see if you can find a match. Decompilation very rarely produces exactly the same code that was originally written, but there will usually be enough structural similarities to make a reasonable comparison.