How to automatically assign an incident to the CI's supported group

Max36
Kilo Explorer

Hello,

I am a beginner in ServiceNow and I wondered if it was possible to assign an incident to an assignee group that is the same that the supported group of the CI mentioned (in the incident).In terms of qualification it looks like "inc.assignment group == cmdb_ci.supported group".

I have read about the assignment rules in ServiceNow, but it doesn't exactly match with what I want to do.

Thank you in advance for your help.

1 ACCEPTED SOLUTION

Bryan Tay3
Mega Guru

hi Max, 

Perhaps you can try create a onChange ClientScript to capture the default Assignment Group on an incident.

Below are the quick sample code i did:

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

//Type appropriate comment here, and begin script below
if(newValue)
{
var caller = g_form.getReference('cmdb_ci', doAlert); // doAlert is our callback function
}
}

function doAlert(caller) { //reference is passed into callback as first arguments
//alert('here='+caller.support_group);
if(caller.support_group)
{
    g_form.setValue('assignment_group',caller.support_group);
}
//else, clear the assignment_group if you wish.
}

find_real_file.png

Hope this helps.

View solution in original post

6 REPLIES 6

Max36
Kilo Explorer

Hi Bryan,

As a newbie I am, I put you code in a business rules instead of in a ClientScript. Since I correct it, it perfectly works.

Thank you very much 😉

 

Community Alums
Not applicable

Hi Max,

I know you have tried ' Assignment Rule' but could you explain what is the problem. According to your requirement you can write a script.

 

if(!current.ci.support_group.isNil()){
   current.assignment_group.setDisplayValue(current.ci.support_group);
)