- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2014 07:48 PM
For reasons I can't go into we need discovery to no longer update the location field but update a new field called Discovered Location u_discovered_location. I can't find the script I need to update. Can anyone help me out?
Solved! Go to Solution.
- Labels:
-
Discovery
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2014 09:50 AM
If you don't want to modify the Shazzam probe, you can also put an "after" business rule on the 'discovery_device_history' table. It holds the CI in a reference field and you can dot-walk to the Discovery Schedule table. Of course that doesn't prevent the location form being written to the location field on the CI record, but I know a lot of clients have been hesitant to modify the OOB probes/sensors. You can set the location record to NULL and erase that value if you want though (or write another BR to reject any update to the location field).
conditions: !current.cmdb_ci.nil() && current.cmdb_ci.changs()
addLoc();
addLoc(){
var sysID = current.cmdb_ci;
var newLoc = new GlideRecord('cmdb_ci_hardware');
newLoc.addQuery('sys_id',sysID);
newLoc.query();
if(newLoc.next()){
//gs.log("Location name is: " + current.status.dscheduler.location);
newLoc.u_discovered_location = current.status.dscheduler.location;
//newLoc.location = NULL;
newLoc.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 08:15 AM
I wouldn't, but it all depends on what field you are trying to prevent from being updated. That's something that is likely bettered handled at the probe/sensor level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2014 12:22 AM
This worked perfectly, thank you!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 10:03 AM
ok Thanks for the info prdelong.