PrashantLearnIT
Giga Sage

Hello Everyone,

 

There is a pretty cool and useful utility in ServiceNow called Script Debugger which enables users with the script_debugger (or admin) role to debug (e.g. pause ) any server-side script that runs in an interactive transaction such as business rules, script includes, script actions, or UI actions that require a response to proceed.

Note: Some script objects, such as script includes, can be called from multiple contexts. For example:

  • when a business rule runs a script include on a form submit that is an interactive transaction waiting on the form data to change before continuing.
  • when a scheduled job runs the same script include that is a non-interactive background transaction that can also run other scripts simultaneously. 

 

To use Script Debugger, follow the following steps:

  1. Open any ‘Server Side’ script (e.g. Business Rule, Script Include, etc).
  2. Form the Syntax Editor Toolbar, click the Open Script Debugger Icon

PrashantLearnIT_0-1715236015435.png

 

  1. This will open the Script Debugger Window, repeat steps 1-3 if you need to debug multiple scripts
  2. Add your Breakpoints by clicking on the gutter next to the script line
  3. Once done, you may start the debugging session by triggering the script (e.g. Create/Update a Record) which will open a new window
  4. The Script Debugger pauses the script on the first line containing a breakpoint.

PrashantLearnIT_1-1715236015450.png

 

 

If my content helped you in anyway, please mark this content as BOOKMARK, SUBSCRIBE & HELPFUL

 

Best Regards,

Prashant Kumar (LearnIT)

 

YouTube Channel LearnIT: https://www.youtube.com/@learnitwithprashant

Blog LearnIT: https://medium.com/@LearnITbyPrashant

Prashant Kumar LinkedIn: https://www.linkedin.com/in/learnitbyprashant/

ServiceNow Community Prashant Kumar - https://www.servicenow.com/community/user/viewprofilepage/user-id/19635