Set assignment group based on contact type field in interaction when it is created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 02:38 AM
Hi,
I have a requirement where i have to set assignment group through script and not allow user to change it. If the contact type field is "chat" then as soon as the interaction is created then it should assign to "Group A"and if interaction is created via email i.e: contact type field is "Email" then it should assign to "Group B".
I have created the onLoad client script but it is not working. Please help.
Group should get set at the same timeinteraction is created.
Kindly,helpme in this regard.
Thanks!
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 02:41 AM
Please post your script here to check why it is not working.
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 02:52 AM
please first check:
Any other scripts setting the assignment group on load?
Is there a reference qualifier on the assignment group field?
use alert to check values proper get .
To check please share following alert results:
function onLoad() {
var cf = g_form.getValue('contact_field');
alert('alert' + cf);
if (cf == 'chat') {
g_form.setValue('assignment_group', 'A');
alert('alert1' + g_form.getValue('assignment_group'));
}
else if(cf == 'email'){
g_form.setValue('assignment_group', 'B');
alert('alert2' + g_form.getValue('assignment_group'));
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 03:46 AM
wrote the same script bt it is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 03:20 AM
Hi,
when interaction is created from chat how are you setting the contact type?
When inbound action is executed you can set the contact type as Email
what did you start with and where are you stuck?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader