When a company Cl is selected, the assignment group of the incident/problem/change should go to the

rajachodisetti
Tera Contributor

When a company Cl is selected, the assignment group of the incident/problem/change should go to the support group or that CI. If Incident is created though self-service, or support group isn't listed on the CI, incident will go to general tech team of the caller

8 REPLIES 8

okay here is the sample script not tested

Script Include:

checkCIGroup: function(){
var ciID = this.getParameter('sysparm_CI');
var ci = new GlideRecord('cmdb_ci');
ci.addQuery('sys_id',ciID);

ci.query();
if(ci.next())
{
return ci.fieldname; // group sysid from CI table support group field

}
},

 

Client script onchange on CI field

 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

var ga = new GlideAjax('scriptincludename');
ga.addParam('sysparm_name','checkCIGroup'); //script include function name
ga.addParam('sysparm_CI',newValue);// send ci sysID
ga.getXML(getInfo);
function getInfo(response) {
var info = response.responseXML.documentElement.getAttribute('answer');
g_form.setValue('assignment_group',info);
}
}

Regards
Harish

Sohail Khilji
Kilo Patron
Kilo Patron

1.To achive this you would need to create multiple  Client script with ajax for each tables like INC,PRB,CNG. (based on your business need).

2. You would need to create a common script include that gets you the sys_id of the support group when a CI is SELECTEDor UPDATED.

3. You would have to handle your script logic to check if sys_id returned by script include is empty or if it is self-service to set the default servicegroup.

 

I hope this helps !

 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

can you update the logic for script include and client script

 

Aman Kumar S
Kilo Patron

Hi @rajachodisetti ,

Go with assignment rules, client script is not required at all, challenge if someone is suggesting using client script, unless there is a specific use case which can't be handled by assignment rules.

 

Best Regards
Aman Kumar