remove option from assignment group

Miroslav5
Tera Contributor

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 {

}


}

7 REPLIES 7

What do you think about change reference qualifier in client script?

Shubham Singh
Mega Guru

Hi @Miroslav5 

 

There is no need to go with Client Script. You can use advanced reference qualifiers to achieve this.

ShubhamSingh_0-1699900044101.png

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 ✔️👍

 

Hi, will it works dynamicaly?