- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 09:35 PM
Hi Team,
How to populate previous assignment group in notification. Whenever ticket is assigning incident to service desk group from any other group we need to send notification. and need populate previous assignment group in notification. and we need send notification to service desk group
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 09:39 PM
you can use eventQueue() based approach
I shared solution for this sometime earlier; enhance the same
Show previous assignmnet group, state values from fields into notification
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
07-12-2023 05:12 AM
send the display value
var obj = {};
obj["old_group"] = previous.assignment_group.getDisplayValue();
obj["new_group"] = current.assignment_group.getDisplayValue();
obj["old_state"] = previous.state.getDisplayValue().toString();
obj["new_state"] = current.state.getDisplayValue().toString();
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2023 05:59 AM
share your scripts
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2023 06:02 AM - edited 07-12-2023 06:03 AM
var obj = {};
obj["old_group"] = previous.assignment_group.setDisplayValue();
obj["new_group"] = current.assignment_group.setDisplayValue();
gs.eventQueue('event_name', current, 'recipient', JSON.stringify(obj));
var jsonObj = JSON.parse(event.parm2);
template.print("Previous Assignment Group: " + jsonObj.old_group);
template.print("<br>");
template.print("Current Assignment Group: " + jsonObj.new_group);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2023 06:05 AM
you didn't copy it correctly.
I mentioned getDisplayValue() but you are using setDisplayValue()
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader