- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 12:33 AM
Hello
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 behaviour 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 Scope, and 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 leading to it.
Flow 1 was originally set with a 'Run Once' trigger and Flow 2 has always used 'Service Catalog' trigger. I've updated Flow 1 to also use the 'Service Catalog' trigger in order to troubleshoot this issue, but it has not changed the behavior.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 06:55 AM
Work Around: Instead of writing the Javascript in flow designer update record java script (inline script), We've created one action which contains java script step where due date was updated using the same new GlideDateTime() which works as expected. Its the bug in the flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 12:15 AM
We are also facing the same issue. In one sub flow where we are creating many change tasks and we are updating the change task due date using the below script.
var date1 = new GlideDateTime();
var sec = 6 * 60 * 60;
date1.addSeconds(sec);
return date1;
In some tasks its working expected whereas in some tasks its showing as GlideDateTime is not defined.
Because of which our development is unable to move further, Any help would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 06:55 AM
Work Around: Instead of writing the Javascript in flow designer update record java script (inline script), We've created one action which contains java script step where due date was updated using the same new GlideDateTime() which works as expected. Its the bug in the flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2024 02:45 PM
While this may work, it shouldn't have to be done that way... inline scripting should work, consistently, from field to field. I'm having the same issue, two flow variables running code, one runs it fine, the second one fails, same exact code... if I flip them around the first one work and the second one fails.
I've opened case for this as well...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2024 10:05 PM
@Daniel Peel Did you get any response from Servicenow for the above issue. We are also facing the same issue after Xanadu upgrade