how to create a new discovery schedule via script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2017 01:59 PM
I am looking to automate new discovery schedule creation (new to service-now discovery). If i have over 100 new schedules (groups by region, division etc) that needs to be created, what would be the best approach to create discovery schedules?
thanks
Alex
- Labels:
-
Discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2017 07:47 PM
You could create a scheduled discovery job then trigger it with a script include, see here for details on StartDiscovery method.
Discovery (Script Include) - ServiceNow Wiki
You could then call it from a client side script using GlideAjax (GlideAjax - ServiceNow Wiki ) or if you're in Geneva you could create a Scripted REST API endpoint (Create a scripted REST API resource) for your external program to call, the nice part about the latter is it's simple to create and provides a nice easy way to pass output back to your external program.
thanks,
vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2017 11:12 PM
Discovery Schedules have the back end table as discovery_schedule in Servicenow.
We can always create a record in a table using various Server Side scripting framework.
But In your case, it depends on the requirement.
If getting an Excel sheet from your client to crate a DISCOVERY SCHEDULE, You can try to import it and use transform maps to directly link it to the target table (discovery_schedule) and the related tables.
You can control the transforms using the transformation script and field mapping.
PS : This approach will save brainstorming on server side scripting.
Thanks,
Prabhash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2017 09:00 AM
Hi Prabhash - Thanks for providing direction. I will explore the import spreadsheet data into the table.