
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2018 03:43 PM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 06:15 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 06:15 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2018 04:26 PM
please use below method for finding interactive session.
gs.getSession().isInteractive();
https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GlideSessionIsInteractive
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2018 04:51 PM
Just tried it. It still shows true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2018 09:19 AM
when user submits ..it is a intereactive session so it runs and it turn out be true ...so whats the issue here

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2018 10:32 AM
I thought the submission is not an interactive session because the insert is done via workflow. I only want the BR to run when the user accesses the list at back-end not at the submission time due to performance concern. So I used gs.isInteractive() to differentiate these two sessions. But as others pointed out these two are all interactive sessions. I need to find other ways to accomplish this. If anyone has insight on how to do this, it would be greatly appreciated.