How to Auto Assign "Change group" to newly discovered CIs in Service now based on Source or Class

Indla
Kilo Contributor

Dear Community Members,

 

I need your help to under stand on how to "Auto Assign "Change group" to newly discovered CIs in Service now based on Source or Class"

 

vCenter has been integrated with Service now and CIs are auto discovered and not getting assigned to any change group. Every time any alert generated for these CI are laying un-attended since these are not assigned to any assignment group.

Need your help to know if there is a way to auto populate change group to these Configuration items based on class.

 

Regards,

Indla

1 REPLY 1

Anand Kumar P
Giga Patron
Giga Patron

Hi @Indla ,

Create new after insert business rule on cmdb_ci table and add below script as per your requirement.

(function executeRule(current, previous) {
    var ciClass = current.sys_class_name; 
    var changeGroup;
    if (ciClass === 'Computer') {
        changeGroup = 'Your computer Change Group';
    } else if (ciClass === 'Software') {
        changeGroup = 'Your software Change Group for this class';
    }
    current.assignment_group = changeGroup;
})(current, previous);

Please mark it as a solution proposed and helpful if it works.

Thanks,

Anand