User Impersonation report in ServiceNow Kingston

georgechen
Kilo Guru

Hello folks, 

I've come to take a challenge to build a reporting in system with user impersonation which will be used by Management to use in case any reasons may raise. 

 

I have some investigation from ServiceNow Doc and noticed a sys_property can be enabled to enable the logging, however, the OOTB log appears to be very basic (in syslog table), 

find_real_file.png

This is a concept only screenshot I wish to build 

find_real_file.png

 

I was wondering if anyone has built something similar or known any plug-in, that would accommodate this sort of reportability? 

 

Thanks in advance. 

 

1 ACCEPTED SOLUTION

Hello George,

 

I tried below code and it worked.

find_real_file.png

find_real_file.png

 

but in above parm1 and parm2 giving user ID, not full name. you can get full name by querying user table.

 

but by thought was to user a custom table to store these logs, as system log table will have very huge data, and i think (not sure) it will be cleared after a specified time.

so by storing his data on a new custom table, you have a historical data also (if needed).

else system log is good.

 

Thanks,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

View solution in original post

8 REPLIES 8

HarshTimes
Tera Guru

Hi George

Whenever someone imporsonate servicenow event engine fire a event impersonation.start and when the impersonation end then fire another event impersonation.end.

You can write a event script and setup a table to capture the details and then you can setup a report on that

 

 

-Harsh

 

Thanks Hash, I have set up a after business rule on the event log table, but it did not seem to fire anyhow (only fires on some other event which wasn't about impersonation), is it because the creation of event log on impersonation bypasses workflow (current.setWorkflwo(false)) to lead the BR not firing?

Thanks advice 

Hello George,

 

The best approach instead of BR would be script action. Script Actions are server side code which runs whenever an event triggers.

https://docs.servicenow.com/bundle/london-platform-administration/page/administer/platform-events/reference/r_ScriptActions.html

 

Thanks,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Thanks Ali, I will give it a crack and update you later about my attempts. 

Cheers,

George