How to Stop Discovery from Populating the Location on CIs?

RK25
Giga Guru

Hi - is there an easy way to prevent discovery from populating the location on the ci except removing the location from discovery schedule? Like a system property or something else? Appreciate any insight!

1 ACCEPTED SOLUTION

AnveshKumar M
Tera Sage
Tera Sage

Hi @RK25 

The CI location is populated from 2 sources, one is from the assigned_to field user record and the other is from Discovery Schedule. Check the following link for KB.

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0864114

 

If you want to prevent the location being populated, you can write an onBefore Business Rule on cmdb_ci table and define the conditions for which the location field should not be set and in the script set the value field to empty. For example if you don't want the location to be populated for Windows Server CIs,

 

When to run: Before - Insert / Update

Conditions: Class :: IS :: Windows Server

Script

(function executeRule (current, previous){

current.location = '';

})(current, previous);

 

 

Please mark my answer helpful and accept as solution if it helped you 👍

Thanks,
Anvesh

View solution in original post

3 REPLIES 3

AnveshKumar M
Tera Sage
Tera Sage

Hi @RK25 

The CI location is populated from 2 sources, one is from the assigned_to field user record and the other is from Discovery Schedule. Check the following link for KB.

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0864114

 

If you want to prevent the location being populated, you can write an onBefore Business Rule on cmdb_ci table and define the conditions for which the location field should not be set and in the script set the value field to empty. For example if you don't want the location to be populated for Windows Server CIs,

 

When to run: Before - Insert / Update

Conditions: Class :: IS :: Windows Server

Script

(function executeRule (current, previous){

current.location = '';

})(current, previous);

 

 

Please mark my answer helpful and accept as solution if it helped you 👍

Thanks,
Anvesh

@RK25 Can you please also accept my answer as solution, if it helped you 👍

Thanks,
Anvesh

Rahul Priyadars
Giga Sage
Giga Sage

There is no System Property OOTB to Control it.

As given in KB you can control it with Some Customization even if LOC is given in Discovery Schedule.

You can create a System Property and Use it to Control in given Script where Location is Set/returned.

 

Regards

RP