Debugging Script Includes

machiavvelli
Tera Contributor

I am trying to debug a script includes being called by an artifact configuration.

I have inserted a "gs.log" statement at the very beginning of the script includes.

I have inserted a second "gs.log" statement at the very beginning of the first function in the script includes.

The first log statement is running, but the second log statement is not.

What would cause a script includes to run but the first function NOT to run?

How do I troubleshoot such a situation?

Thanks for your assistance.

11 REPLIES 11

@machiavvelli 

are you sure you can call script include from that place?

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

Like I said, the script includes is running, because the first log statement is being generated.  So, the artifact configuration is calling the script includes.  That part works.

Hi @machiavvelli, I believe you are missing "new" keyword while calling the script include.

Try calling like as below, it should work. It did print both logs for me.

new LF_PortalProcessor().getTranslatableContent(params);

I don't know how to do that.  The script includes is being called from an artifact configuration.  It is not being called using a line of code.  Please see the attached screenshot of the artifact configuration.

Word documents are not helpful. use the "</>" icon here to paste text.