Script Debugger not Working

aj78
Kilo Contributor

Hi,

While trying to debug the business rules script the script debugger is not responding.

I have placed the code in business rules > script pane. The condition is placed to trigger business rule is implemented 'after database Insert' on 'live_message'.

Since last successful update of Madrid. Debugger is not working properly. Breakpoints are not able to pause the flow of execution.

Kindly help.

Regards

aj

1 ACCEPTED SOLUTION

emyrold
Giga Expert

I have a script include in a scoped app that I used to be able to step through in the debugger and now the Debugger just sits at Status: WAITING_FOR_FIRST_BREAKPOINT user: System Administrator.

I read in Doc's that it will work if isInteractive() is true

var interActive = gs.getSession().isInteractive();

gs.info(interActive);

When I run this in scripts background, it says false.  I know I used to be able to call this and step through, any suggestions or ideas?

Just created this test in a scoped app:

created basic script include and set accessible from "all application scopes"

name: test

script: 

function test() {
	return 'hello world';
}

// called from scripts backgroun in the same scope
gs.info(test());  // hello world

 launched script debugger from the script include, added break point and it never stops at breakpoint

View solution in original post

21 REPLIES 21

Service_RNow
Mega Sage
Hi AJ,
You cannot run the script directly from the script debugger.
1. You have to set the break points in the script first.  Reference: Set or remove breakpoints
2. Then you have to open the script debugger by clicking on the script debugger icon placed above the script.
3. Now try to execute the code by triggering business rules or whatever that will hit the block of code where your break points are.
4. If you perform above 3 steps successfully, your script debugger will pause the execution at your break point. and you will be given an option to resume the execution.
NOTE: script debugger doesn't work with impersonation. 
 Thank you,
 
Please mark the answer helpful/correct if applicable.

aj78
Kilo Contributor

Hi RamS,

Step 1. Set Breakpoints

find_real_file.png

Step 2. Open script debugger from the icon 

find_real_file.png

Step 3. Trigger business rule.

Step 4. Debugger stops at the breakpoint. NOT WORKING (This was working before the update).

 

Any more suggestions.

aj78
Kilo Contributor

It seems the business rule creation has changed in comparison to what is mentioned in the docs https://developer.servicenow.com/app.do#!/training/article/app_store_learnv2_scripting_madrid_server...

Current UI & Options

Chris L5
Tera Contributor

I am having the exact same issue that AJ is having.

I have followed these steps exactly.. and still no luck.

Note: The Script Include is working properly.. and is triggered by the BR as intended.

This is even for a simple "hello world" scenario.. just to avoid having too many moving pieces to worry about.

 

Code works.. Debugger does not.

 

Update: I just tried this on a Free Developer Instance.. and it works as intended...

But it does NOT work on our Project's Dev Instance... /shrug

 

Free Dev Instance Screen shot (showing things working)find_real_file.png