remove option from assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 10:09 AM
Hello Guys, I made easy clienet script but absolutely dont know why its not working. My task is, when caller_id is tieto_integration_user and state changes to resolved, then exclude fujitsu service desk from assignment group so SD cant choose this group for resolving ticket. But its not working and dont know why.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var callerId = g_form.getValue('caller_id');
var tietoUserId = '4044c51bdba29f007210fba6689619e5'; //sys_id of tieto_user
// Check if caller is 'tieto_user' and state is 'Resolved'
if (callerId === tietoUserId && newValue === '6') {
// Restrict selection of 'Fujitsu Service Desk' in assignment group
var fujitsuServiceDesk = '1c1cc2e2c867ab00b051c7906960cf3e'; //sys_id of fujitsu SD
g_form.removeOption('assignment_group', fujitsuServiceDesk);
} else {
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 10:41 AM
What do you think about change reference qualifier in client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 10:28 AM - edited 11-13-2023 10:33 AM
Hi @Miroslav5
There is no need to go with Client Script. You can use advanced reference qualifiers to achieve this.
javascript: if(current.state=='6' && current.caller_id=='4044c51bdba29f007210fba6689619e5'){ return group!=1c1cc2e2c867ab00b051c7906960cf3e} else {return};
Thanks!
Please mark it as correct and helpful if it works ✔️👍
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 11:24 AM
Hi, will it works dynamicaly?