Trigger an impersonation start event
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2025 09:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2025 06:16 AM
You can set up your own, custom, policy to do that.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2025 12:34 AM
Hi Lexa, here`s a example of a function that can start and event when a user is impersonated, let me know if you need further help or mark my answer as helpful if it fits your needs:
(function() {
var userEmail = 'user@example.com'; // Replace with the email you want to query
var userGr = new GlideRecord('sys_user');
userGr.addQuery('email', userEmail);
userGr.query();
if (userGr.next()) {
var userSysId = userGr.sys_id.toString();
var imp = new GlideImpersonate();
if (imp.isImpersonating()) {
var currentUserSysId = gs.getUserID();
if (currentUserSysId === userSysId) {
gs.info('User with email ' + userEmail + ' is currently impersonated. Triggering action...');
// Add your custom action here
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2025 02:20 AM
@Community Alums
whenever you impersonate there is an event logged here
You can have logic on that table and determine who impersonated which user
Parm1 - user who initiated the impersonation
Parm2- user impersonated by Parm1 user
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2025 01:49 AM
@Community Alums
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2025 11:19 PM
Hello Ankur,
I applied After insert business rule on sysevent table but it not responding anything.
Also I created flow on sysevent table to trigger notification But it not responding anything.
Can you please help me?