Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to create Service Mapping discovery schedule

Antal1
Tera Contributor

How do I create a discovery schedule for business services which have entry points defined? I do not want to run horizontal host or application discovery but the top-down discovery of service mapping.

Currently the only option I see is to reuse the script from Run Discovery UI action and create my own schedule record:

var bsManager = new SNC.BusinessServiceManager();

bsManager.startDiscovery(current.sys_id);

1 ACCEPTED SOLUTION

Antal,


Your business services need to be set to in operation status for the scheduled job to run. It only runs them on a schedule if they have been marked as operational on the business service form. This should get you past this .


View solution in original post

14 REPLIES 14

Patrick DeCarl1
ServiceNow Employee
ServiceNow Employee

Antal,



Application discovery is the top down discovery. Check out Create a discovery schedule for an application CI


What is the reason for not going with OOTB process to keep your maps up to date?



If you want to run a custom schedule, you can go to "Scheduled Jobs" and create a custom job to run below code



var map = new GlideRecord('cmdb_ci_service_discovered'); //Query the business services


map.addQuery('');   // Need to update query


map.query();


while (map.next()) {




      var bsManager = new SNC.BusinessServiceManager();


      bsManager.startDiscovery(map.sys_id);


}


Hi Patrick,


Although I have 20 services, the All applications schedule does not do anything when I run it.



What process are you referring to please?


What do you mean it doesn't do anything? When the discovery runs what do you get back in the ecc?


Like I say, it is empty, it completes instantly


find_real_file.png