Skip to end of metadata
Go to start of metadata

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.

Step-by-step guide

  1. Look for a line in the stack trace that refers to ScriptXXX.groovy, where XXX is a number.
  2. On the server where the Jira home directory is located, enter that directory and then navigate from there to the scriptrunner/classes directory.
  3. In scriptrunner/classes, locate the file ScriptXXX.class, where XXX is the same number you identified in step 1.
  4. Take a copy of that .class file and decompile it. Many Java IDEs have this functionality built in, or you can use an online service such as javadecompilers.com.
  5. 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.