gs.isInteractive() always returning false, even in a Background script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 01:26 PM
Pretty simple question & I must be missing something simple here.
Both:
gs.isInteractive()
&
gs.getSession().isInteractive()
Return 'false' when run in a background script. Isn't the whole purpose of these to determine if the user is in an active session in ServiceNow?
Running:
gs.print(gs.isInteractive());
Prints as false in a background script.
Any idea what needs to change here?
Thanks.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 01:35 PM
check the last comment in below thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 09:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2020 10:53 PM
If so, can you please mark Correct? This will close the thread and makes the answer easier to find for others.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 10:06 PM
Try it in a business rule rather a Background Script.
Thanks,
Saji