Forums

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

Unable to import class from scripts folder in Inline script

Jonatan Hospital August 30, 2018

Hello,

I'm trying to import in my post-function inline script a class created in my /scripts/ folder.

I must use the same code with values which can be different in the future and I really don't want to maintain 10+ different inline scripts with the same code... Is there any way to get imports correctly? Or any other solution to fix this?

If not, is there any way to pass parameters to a script file? Or, from script file, will I be able to get ComponentAccesor, current user, current issue, etc?

The problem:

The script could not be compiled:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script585.groovy: 4: unable to resolve class common.groovy.Utilities @ line 4, column 1. import common.groovy.Utilities ^ 1 error

But in the 'script file' I can find it.

1 answer

1 accepted

0 votes
Answer accepted
Jonatan Hospital August 30, 2018

I can't import utils to inline script, so I updated my inline script as a file script and used it instead of inline.

It works.

Suggest an answer

Log in or Sign up to answer