Auto populate Assignment group based on CI related item service support group

Reddy34
Tera Contributor

Hi All,

 

I have a requirement to populate the assignment group based on CI related item Service support group .

see below screen  shorts.

 

1. In the Incident form open the Configuration item 

Reddy34_0-1693240775031.png

2. Open services related items under that CI

Reddy34_1-1693240847440.png

3. See the service Group in that 

Reddy34_2-1693240934460.png

 

4. That assignment group need to populate Incident form assignment group

 

Kindly suggested me on this ,

Thank you !

 

 

 

8 REPLIES 8

Eswar Chappa
Mega Sage

@Reddy34 

 

Create a Client script like this:


Name : Populate assignment Group


Type : onChange


Field Name : cmdb_ci


Script:



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


    if (isLoading || newValue === '')


          return;


  var ref = g_form.getReference('cmdb_ci');


g_form.setValue('assignmnet_group', ref.support_group); // support_group is the name of the field on cmdb from which you want to get the group


}

 

Thanks & Regards,

Eswar Chappa

Mark my answer correct and Helpful if this helps you 😀

 

Eswar Chappa
Mega Sage

 

 

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

    var ci = g_form.getReference('cmdb_ci', agLookup);
    function agLookup(ci){    
     g_form.setValue('assignment_group', ci.assignment_group);
    } 
}
View

 

 

 

Thanks & Regards,

Eswar Chappa

Mark my answer correct and Helpful if this helps you 😀

 

 

Thanks for your reply ,

 

As per my understand we have to write script in Assignment rules not in client script .

 

when incident form will open by automatically CI will populate ,that we cannot change .based on that CI related item service support group need to populate in incident form .

 

Any suggestions 

 

Prabu Velayutha
Mega Sage

Hi @Reddy34 

 

Every CI may have relationship or hosting or used by multiple Application Services. Do you have any specific criteria to choose any specific  Application Services , As shown is your screenshot the same CI is used by SAP Controlling, SAP financial controlling etc, is that matters or you can select any? because this is very critical to determine which service to lookup for the support group for assigning the incident in this approach. 

 

Also you need query the  SVC_CI_ASSOC table to get all the Service Related to the CI and get the support group of the Service, so you need to have Script Include to get this value for the client script to populate the Assignment group. 

 

I can help you with the script include if you need. Let me know if you have questions.

 

If my answer helped, please mark it helpful and correct. Thanks!