gs.isInteractive() is not working as expected

Joy1
Giga Contributor

Can someone help me troubleshoot the following business rule? I use gs.isInteractive() to make sure that it runs when the user logs in the platform but not when in a non-interactive session. But it does run when the user submits a request and the log statement shows "gs.isInteractive(): true".

By the way, it's on Kingston.

Befrore query table sc_req_item.

(function executeRule(current, previous /*null when async*/) {

gs.log('gs.isInteractive():' + gs.isInteractive());

if (!gs.isInteractive()) { 

gs.log('!gs.isInteractive():' + !gs.isInteractive());

return;

}

// do some processing here

})(current, previous);

 

Any help would be much appreciated.

 

Joy

1 ACCEPTED SOLUTION

Please close the thread by marking my response correct if it worked for you


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

14 REPLIES 14

SanjivMeher
Kilo Patron
Kilo Patron

Where is the user submitting the request?


Please mark this response as correct or helpful if it assisted you with your question.

Joy1
Giga Contributor

It was submitted through a portal page.

Service portal in ServiceNow? Or external portal?

If external portal, which user account are you using to do that.


Please mark this response as correct or helpful if it assisted you with your question.

Joy1
Giga Contributor

It's Service portal in ServiceNow.