- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 09:23 PM
Hello Team,
I have a requirement that from script include I want to trigger the Scheduled Job. In script include i have function that
if my function return True then my schedule job got trigger and in that schedule job I have written gs.eventqueue(notification) that will be trigger after 30 min
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 10:34 PM
then why not write that scheduled job script within your script include?
no need to call schedule job then
if(function return value is true){
// your job script here
}
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 09:57 PM
check this script
//Execute a scheduled script job
var rec = new GlideRecord('sysauto_script');
rec.get('name', 'YOUR_JOB_NAME_HERE');
gs.executeNow(rec);
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 10:02 PM
@Ankur Bawiskar can we call my function in Schedule job ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 10:05 PM
you call the schedule job; when schedule job runs it will run your script which has that function?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 10:09 PM
Requirement is like - In my script Include I have a function () if it returns Ture then this schduled job will run and trigger my Email notification also