How to Debug a Script in Assignment Rule

Michael Gedzelm
Tera Contributor

Hi.  I am trying to learn how to write a simple script in the "Assignment Rule" area.  It doesn't really matter what I'm trying to do in the script.  What matters is that I can't seem to get any debugging tools to work.  I've used session logs and breakpoints when writing code for widgets.  However, for assignment rules, nothing seems to work.  I've been searching forever and have come up with absolutely nothing.  Not a thing.  Does anyone know how to do this?  Thanks.

1 ACCEPTED SOLUTION

Mohith Devatte
Tera Sage
Tera Sage

Hello @Michael Gedzelman ,

try putting gs.info() or gs.log().

This should work 

MARK THIS ANSWER CORRECT IF THIS HELPS YOU

View solution in original post

4 REPLIES 4

Mohith Devatte
Tera Sage
Tera Sage

Hello @Michael Gedzelman ,

try putting gs.info() or gs.log().

This should work 

MARK THIS ANSWER CORRECT IF THIS HELPS YOU

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

any server side can be debugged using gs.info() statements.

Don't use gs.log() as it will break your code in scoped applications as gs.log() is not supported in scope app.

Regards
Ankur

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

Michael Gedzelm
Tera Contributor

Thank you Mohith and Ankur.  You have both helped me.  I am new to all of this.  By using gs.info (you're correct Ankur, gs.log broke my code), it created a marker in the system log, so I could better see where the actual error is.  The next record in the system log was the error message.  Once I fixed that, everything worked.  Thanks.

@Michael Gedzelman 

Glad to know that my comment helped you resolve the issue regarding not to use gs.log().

Did you mistakenly marked other response as correct?

Would you mind marking my response as correct?

Regards
Ankur

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