- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 07:15 PM
Hello All,
We got a requirement from customer like when RITM gets updated or any comments added in the RITM then an email notification will be send to User/Group Watchlist members.
For that I created a Variable Set, in that i have created 2 variables with list collector type.
1. User Watchlist-reference to user table.
2.Group Watchlist-reference to group table.
I have created a new Notification to sc_req_item table but i'm unable to select Variable set or variables inside variable set so that those members can get emails.
Please help me how we can achieve this and what are steps needs to be followed.
Can we achieve this by email script?
@Ankur Bawiskar @Community Alums
Thanks,
Abdul
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 04:24 AM
why would the variable change later on? Ideally they should not once RITM is submitted.
It's not recommended.
you can use workflow run script to set the fields using the variables
Simply use this logic
1) when RITM is created populate the fields on RITM with the variable values -> workflow run script
current.setValue('watch_list', current.variables.users_watchlist.toString());
current.setValue('group_list', current.variables.group_watchlist.toString());
2) then have Insert, Update Notification and set the recipient as those 2 fields
3) condition is Comments changes
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
03-08-2024 01:52 AM
you can use this logic
1) use after insert BR on RITM or use workflow run script
2) get the users from both the variables and use gs.eventQueue() based approach to send the email
3) create event, email on RITM table
I hope you are aware how to create event, link it with email and use eventQueue()
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
03-08-2024 04:17 AM
Thanks @Ankur Bawiskar . It works when RITM is created and then we update the ritm.
I think we need to update the BR script, i think some logic is missing.
I created a Before Insert/Update BR on RITM table, please check and correct the script if i did anything wrong.
BR script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 04:24 AM
why would the variable change later on? Ideally they should not once RITM is submitted.
It's not recommended.
you can use workflow run script to set the fields using the variables
Simply use this logic
1) when RITM is created populate the fields on RITM with the variable values -> workflow run script
current.setValue('watch_list', current.variables.users_watchlist.toString());
current.setValue('group_list', current.variables.group_watchlist.toString());
2) then have Insert, Update Notification and set the recipient as those 2 fields
3) condition is Comments changes
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
03-08-2024 04:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 06:30 AM
Glad to know.
Please mark my response as correct and close the thread
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader