Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate class error on scriptrunner

Gaston
April 20, 2026

 Hi,

I'm facing an intermittent issue with ScriptRunner (Jira Data Center) that seems related to class loading / caching.

Error

 

Invalid duplicate class definition of class EquipoJira.UtilidadesCampos :
The sources /home/jira/scripts/EquipoJira/UtilidadesCampos.groovy and
file:/home/jira/scripts/EquipoJira/UtilidadesCampos.groovy each contain
a class with the name EquipoJira.UtilidadesCampos.

 

File

 

/home/jira/scripts/EquipoJira/UtilidadesCampos.groovy

 

🧱 Class definition

 

package EquipoJira

public class UtilidadesCampos {
    public static Tuple2<String, String> GetRamoProducto(Issue issue) {}
}

 

📥 Usage

 

import EquipoJira.UtilidadesCampos

UtilidadesCampos.GetRamoProducto(issue)

 Context

  • The class is defined in the ScriptRunner script root.
  • It is used across multiple scripts via import.
  • The error appears intermittently, not consistently
  • There are no duplicate files with the same name in the filesystem.

 

What is the recommended way to define reusable utility classes in ScriptRunner without hitting this issue?

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
vikram
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
April 21, 2026

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

Gaston
April 21, 2026

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?

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events