Triggering Scheduled discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2023 11:07 PM
HI ,
I'm trying to trigger a scheduled discovery from script , but its not working as expected.
var rec = new GlideRecord('sysauto_script');
rec.addEncodedQuery('name','name=Cloud Service Account - ******');
rec.query();
SncTriggerSynchronizer.executeNow(rec);
the above script is not triggering from background script.
Thanks in advance,
Subin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2023 11:21 PM
Hi,
Your encoded query looks weird. Double check it.
Or you can run it like this
var rec = new GlideRecord('sysauto_script'); rec.get('name', 'YOUR_JOB_NAME_HERE'); SncTriggerSynchronizer.executeNow(rec);
Regards,
Niklas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2023 09:16 PM
Hii,
You can ensure that the GlideRecord query is correctly formatted, for example: rec.addQuery('name', 'Cloud Service Account - ******'); Also, check if the GlideRecord query actually returns the desired record and if the SncTriggerSynchronizer execution fits within your script's context.
YourTexasBenefits