Workflow not triggering scoped script

Chris45
ServiceNow Employee
ServiceNow Employee

workflow not triggering scoped script with empty scratchpad after checking out WF, and same error after publishing WF, though previous run works. it looks like scoped script(non Global) IaCloneRollbackWf is not recognized by the WF, error message is not quite helpful, how to troubleshoot such case? any backend log available

 

Run script activity: 

IaCloneRollbackWf.script.preflightCheck();
 

error message as below

org.mozilla.javascript.WrappedException: Wrapped TypeError: Cannot read property "script" from undefined (preflightCheck - advanced script; line 1) (<refname>; line 48)

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Chris45
ServiceNow Employee
ServiceNow Employee

NW, found cause with background script testing, script calls a global script without prefix, it'd be much easier if  WF error msg is clearer

View solution in original post

9 REPLIES 9

Chris45
ServiceNow Employee
ServiceNow Employee

script IaCloneRollbackWf is defined under scope IA Clone, and it worked before checking out WF

Ankur Bawiskar
Tera Patron
Tera Patron

@Chris45 

sorry but you didn't share any screenshots etc and what are you trying to achieve here?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Chris45
ServiceNow Employee
ServiceNow Employee

Workflow's first activity is preflightCheck, and it calls IaCloneRollbackWf.script.preflightCheck(); when start the WF with given input, it didn't trigger the script, screenshot attached

@Chris45 

we don't know what that line does

did you check what it does?

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader