Hi,
I'm facing an intermittent issue with ScriptRunner (Jira Data Center) that seems related to class loading / caching.
What is the recommended way to define reusable utility classes in ScriptRunner without hitting this issue?
Hi @Gaston
try this, if it helps
check below
- Go to ScriptRunner → Settings → Script Roots.
- Ensure only one root path is defined (e.g., /home/jira/scripts).
- Remove duplicates or overlapping paths that point to the same directory.
try
clearing ScriptRunner caches
trying using Consistent Imports
import EquipoJira.UtilidadesCampos
Thanks. I verified a few things on my side:
There is only a single script path configured: /home/jira/scripts
UtilidadesCampos.groovy contains only one class definition:
package EquipoJira
class UtilidadesCampos { ... }
I am importing it consistently as:
import EquipoJira.UtilidadesCampos
I also confirmed that this file is not being loaded via GroovyShell, evaluate, parseClass, or similar mechanisms
Even with that, the error still appears intermittently:
Invalid duplicate class definition of class EquipoJira.UtilidadesCampos
with the same file being referenced both as a filesystem path and as a file: URL.
Also, clearing ScriptRunner caches several times sometimes makes the issue disappear temporarily, which makes this look more like a classloader/cache invalidation problem than a duplicated file or import issue.
Is this a known issue in ScriptRunner for Jira Data Center?
Are there recommended patterns for reusable helper classes under the script root to avoid this kind of intermittent duplicate class definition error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.