-
Notifications
You must be signed in to change notification settings - Fork 857
User impersonation activity logger #2401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User impersonation activity logger #2401
Conversation
Added README for User Impersonation Activity Logger, detailing its functionality, usage instructions, prerequisites, and dependencies.
@ravichandra1998g - Added the changes again in a correct way following the existing predefined structure, Please review and merge. Please do let me know if anything needs to be changed. |
Server-Side Components/Business Rules/User Impersonation Activity Logger/README.md
Outdated
Show resolved
Hide resolved
Removed Hacktoberfest 2025 section and License information from README.
Hello @Its-Nmk |
@ravichandra1998g - I have done the changes, please verify. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can still see the script in the Readme file
// Script: | ||
(function executeRule(current, previous /*null when async*/) { | ||
if (new GlideImpersonate().isImpersonating()) { // Check if the user is impersonating | ||
if (current.comments.changes() || current.work_notes.changes()) { // Check if comments or work notes have changed | ||
let actualUserName = gs.getImpersonatingUserDisplayName(); | ||
let impersonatedUserName = gs.getUserDisplayName(); | ||
let logMessage = `User Impersonation Activity Detected: | ||
Timestamp : ${ new GlideDateTime()} | ||
Actual User: ${actualUserName} | ||
Impersonated User: ${impersonatedUserName} | ||
Comments added: ${current.comments || 'NA'} | ||
Work Notes added: ${current.work_notes || 'NA'}`; | ||
gs.info(logMessage); | ||
} | ||
} | ||
})(current, previous); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do not need to add the script again in a Readme file.
Can you please remove this part too...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravichandra1998g - I have removed the code but just having a placeholder for script to highlight that we need to add a code in BR.
Removed user impersonation logging logic from the script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good now
PR Description:
replace this with your description
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/
Server-Side Components/
Client-Side Components/
Modern Development/
Integration/
Specialized Areas/
Documentation
Restrictions