Hi,
I have created some Insight Automation which executes a Groovy script. The script works fine when used in scriptrunner script console. But when I add it to an Insight Automation rule, it does not work.
I checked the server logs and found that the issue is it is unable to resolve some local and scriptrunner classes.
Can anyone please tell me how I import these types of classes to work here?
Below is the errors:
Error when executing groovy script: /opt/atlassian/application-data/jira/shared/custom-jira-functions/insight-automation/ukicmdb/map-insight-user-to-jira-user.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/shared/custom-jira-functions/insight-automation/ukicmdb/map-insight-user-to-jira-user.groovy: 9: unable to resolve class shared.User
@ line 9, column 1.
import shared.User
^
/shared/custom-jira-functions/insight-automation/ukicmdb/map-insight-user-to-jira-user.groovy: 8: unable to resolve class shared.Insight
@ line 8, column 1.
import shared.Insight
^
/shared/custom-jira-functions/insight-automation/ukicmdb/map-insight-user-to-jira-user.groovy: 10: unable to resolve class shared.Environment
@ line 10, column 1.
import shared.Environment
^
/shared/custom-jira-functions/insight-automation/ukicmdb/map-insight-user-to-jira-user.groovy: 7: unable to resolve class com.onresolve.scriptrunner.runner.customisers.WithPlugin
@ line 7, column 1.
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
^
/shared/custom-jira-functions/insight-automation/ukicmdb/map-insight-user-to-jira-user.groovy: 6: unable to resolve class com.onresolve.scriptrunner.runner.customisers.PluginModule
@ line 6, column 1.
import com.onresolve.scriptrunner.runner.customisers.PluginModule
^
5 errors