How can we automatically populate the location field value based on the naming convention of systems

Ria
Tera Contributor

How can we automatically populate the location field value based on the naming convention of systems, but only when the location field in the CMDB is empty? For example, if the system name begins with 'STL,' the location field should be updated to De-Stolberg.

2 REPLIES 2

anand-bhosle
Tera Guru

Hi @Ria 

You can achieve this by creating a before Business Rule [insert/update] and condition location ==empty. 

Gomathi Kannan
Tera Guru

Hi @Ria ,

 

You can configure the before insert BR with condition location is empty

 

In script section, write the below code

var systemName = current.name;

if(systemName.startsWith("STL"))

{

current.location='sys_id of your location';

}

 

In addition to above suggestion, you can also try to configure the Dynamic CI group to set non-discoverable attribute of CI.

FYR: https://www.servicenow.com/community/itom-forum/set-ci-attributes-using-dynamic-ci-group/m-p/944467

 

BR,

Gomathi K