GlideDateTime() works on one flow, 'Error: "GlideDateTime" is not defined' on the other

Josh102
Kilo Guru

Hello,

 

I have two different flows that use identical inline scripts on the same input of the same action. One is working as expected, the other is throwing an error at new GlideDateTime().

Flow 1 uses the following inline script to generate a value for a 'description' input to a custom action:

 

var time = new GlideDateTime();
var desc = "Terminated via ServiceNow Orchestration " + time.getDisplayValue();
return desc

 

This works successfully and passes the value with the current date and time displayed.

 

Flow 2 uses the exact same inline script (copy-pasted) to generate a value for the same input for the same custom action. Flow 2 errors on that custom action with the following error message:

IPaaSActionProbe | Operation(Flow 2.b8f274781bd87550d11720a7b04bcb9f.InlineScript_description5ef2f4784dd8755071c128e5866d4864) failed with error: com.snc.process_flow.exception.OpException: Error: "GlideDateTime" is not defined.
at com.snc.process_flow.operation.script.ScriptOperationBase.handleScriptResult(ScriptOperationBase.java:64)
at com.snc.process_flow.operation.script.ScriptOperationBase.runScript(ScriptOperationBase.java:52)
at com.snc.process_flow.operation.script.ScriptOperation.run(ScriptOperation.java:74)
at com.snc.process_flow.engine.Operation.execute(Operation.java:212)
at com.snc.process_flow.restricted_caller_access.ExecuteWithoutCallerAccessTracking.executeWithMetaStack(ExecuteWithoutCallerAccessTracking.java:10)
at com.snc.process_flow.engine.ProcessEngine.executeOps(ProcessEngine.java:597)
at com.snc.process_flow.engine.ProcessEngine.runInternal(ProcessEngine.java:498)
at com.snc.process_flow.engine.ProcessEngine.resume(ProcessEngine.java:489)
at com.snc.process_flow.engine.ProcessAutomation.run(ProcessAutomation.java:84)
at com.snc.process_flow.engine.ProcessAutomation.run(ProcessAutomation.java:60)
at com.snc.process_flow.engine.ProcessAutomation.resume(ProcessAutomation.java:56)
at com.snc.process_flow.engine.MidProcessAutomation.resumeFlow(MidProcessAutomation.java:55)
at com.service_now.mid.probe.IPaaSActionProbe.lambda$probe$0(IPaaSActionProbe.java:126)
at com.glide.util.LogContext$Frame.run(LogContext.java:247)
at com.service_now.mid.probe.IPaaSActionProbe.probe(IPaaSActionProbe.java:96)
at com.service_now.mid.probe.AProbe.process(AProbe.java:154)
at com.service_now.mid.queue_worker.AWorker.runWorker(AWorker.java:131)
at com.service_now.mid.queue_worker.AWorkerThread.run(AWorkerThread.java:20)
at com.service_now.mid.threadpool.ResourceUserQueue$RunnableProxy.run(ResourceUserQueue.java:649)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

 

The expected behavior is that Flow 2 would behave the same way as Flow 1. Could someone help me to identify why this is happening?

 

I have a feeling this has something to do with Scopes, but I'm not very familiar with scopes, I usually do everything in Global. Both flows are published, and in the Global application. The custom action is published and in the Global application.

The only difference between the flows that I can see when I go to sys_hub_flow.list; The Compiler Build for Flow 1 is empty, but the Compiler Build for Flow 2 is "glide-utah-12-21-2022__patch4-hotfix2-06-23-2023_06-23-2023_2224.zip". 

 

It may also be worth noting that Flow 1 was a test flow created to test this error and it only has the single action. Flow 2 is a larger flow with 13 actions prior to this action producing the error. 

 

Flow 1 was originally set with a 'Run Once' trigger and Flow 2 has always used 'Service Catalog' trigger. I've since updated Flow 1 to also use the 'Service Catalog' trigger in order to troubleshoot this issue, but it has not changed the behavior. 

0 REPLIES 0