send notification to all group managers of a user when user department changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 01:40 AM
Requirement : Send Notification when user’s department is changed.
- Check User that they are in any Group Member or not.
- If that User is in Group Member, system remove user who change department from their previous Group Member automatically. (User should be removed from all the groups)
- Send notify mail to inform the previous Group Manager that the Changed department User already removed from Group, because of their department changed.
- If Group Manager still need to add this User back in the previous Group, can be added manually.
Mail Notification: Notification can be sent when user department changed. Need ServiceNow system to send mail notify to previous Group Manager
UC1: Notify mail to the previous Group Manager
Email to (who): Notification to the previous [Group Managers] that user is removed off.
Email Body (what): User (ID and Name) department changed from Previous Department to New Department on Detected Date, and already removed from Group Member automatically.
Email Subject: ServiceNow User Department change detected
Member name: [FirstName-LastName]
Effected Group name: Previous [GroupName]
Status: [Status]
Detected date: [xxx]
Actions: To be notified the updated group members
User is automatically removed from Group.
How many notifications to be sent? 1 time when that user automatically removed from Group.
-----------------------------------------------------------------------------------------------------------------------------------------
so, this is my task and my approach is to
1. create an event trigger when the user department is changed {table selected sys_user}
2. when the event is fired then the notification should run accordingly.
3. write a business rule to get all the info of the managers, which I stored in variable name managers.
4. then create another event to transfer the variable managers from business rule to email script in the recipient
5. then wrote the email script for the custom email template i wanted.
-----------------------------------------------------------------------------------------------------------------------------------------
but it's not working!! below are the business rule i used and also the email script i used
Business Rule Script:
-----------------------------------------------------------------------------------------------------------------------------------------
Email script i used:
-----------------------------------------------------------------------------------------------------------------------------------------
screenshot of the event registration to get variable managers from business rule
-----------------------------------------------------------------------------------------------------------------------------------------
screenshot of notification
-----------------------------------------------------------------------------------------------------------------------------------------
when checking to any error in the system log then it shows Analytics framework send status not success, instead is 7
IF ANYONE HAS MORE EASIER WAY TO PERFORM THE TASKS PLEASE LET ME KNOW!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 02:39 AM
I think you need to start by going back to the person giving you this requirement. Why are you removing a person from all groups on department change and asking the manager of the group if the person is correctly removed? If the answer is 'yes', this person is unable to do his job until the group manager puts him back in. Shouldn't it be the other way around: "Dear group manager, John has moved from department X to department Y. Please validate if he needs to remain member of your group for doing his Job."
You could even just create approval records for this: approved = stay, rejected is auto-remove.
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-21-2024 05:55 AM
the above requirement is correct the managers can add the use again if needed