Groovy script in Insight automation rules not executed due to not in whitelist, missing file or lack permission
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Common Problems
The automation rule to trigger a Groovy script was triggered as expected but the script wasn't executed.
The following appears in the insight_automation.log.
2021-12-01 15:15:59,576 [insight-event-8] | GroovyScriptAction, got absFilePath: /Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy
2021-12-01 15:15:59,577 [insight-event-8] | GroovyScriptAction, not in whitelist, exit, absFilePath: /Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy
2021-12-01 15:15:59,576 [insight-event-8] | GroovyScriptAction, got absFilePath: /Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy
2021-12-01 15:15:59,577 [insight-event-8] | GroovyScriptAction, missing file, absFilePath: /Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy
2021-12-01 15:50:50,076 [insight-event-4] | GroovyScriptAction, got absFilePath: /Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy
2021-12-01 15:50:50,078 [insight-event-4] | Execute groovy script: /Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy
2021-12-01 15:50:50,222 [insight-event-4] | AutomationRuleGroovyScriptAction, Unexpected error: /Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy can not be read. Check the read permission of the file "/Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy" (/Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy).
java.lang.RuntimeException: /Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy can not be read. Check the read permission of the file "/Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy" (/Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts/Move Object to Archive.groovy).
at groovy.lang.GroovyCodeSource.<init>(GroovyCodeSource.java:118)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:621)
at com.riadalabs.jira.plugins.insight.services.core.impl.GroovyServiceImpl.evaluate(GroovyServiceImpl.java:86)
at com.riadalabs.jira.plugins.insight.services.automation.action.AutomationRuleGroovyScriptAction.doActionSafe(AutomationRuleGroovyScriptAction.java:99)
at com.riadalabs.jira.plugins.insight.services.automation.action.AbstractInsightAutomationAction.doAction(AbstractInsightAutomationAction.java:107)
at com.riadalabs.jira.plugins.insight.services.automation.rule.impl.AutomationRuleEngineImpl.executeAction(AutomationRuleEngineImpl.java:669)
at com.riadalabs.jira.plugins.insight.services.automation.rule.impl.AutomationRuleEngineImpl.executeActions(AutomationRuleEngineImpl.java:654)
at com.riadalabs.jira.plugins.insight.services.automation.rule.impl.AutomationRuleEngineImpl.matchConditionAndExecuteActions(AutomationRuleEngineImpl.java:453)
at com.riadalabs.jira.plugins.insight.services.automation.rule.impl.AutomationRuleEngineImpl.handleScheduledEvent(AutomationRuleEngineImpl.java:351)
at com.riadalabs.jira.plugins.insight.services.automation.event.AutomationRuleEventListener.onScheduledEvent(AutomationRuleEventListener.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:87)
at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:144)
at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:72)
at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:34)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Diagnosis
Environment
Any Insight versions
Diagnostic Steps
For scenario 1 and 2, the status of the rule will be a green check mark even though the script actually failed to be executed. For scenario 3, the status of the rule will be a red exclamation mark as shown in the screenshot below.