- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 05:40 AM
The ask is to have the record producer send incidents to a different assignment group for after hours work in a different timezone. To begin work on this, I have set up a schedule [cmn_schedule] and am wanting to create a script that will run against a record producer to determine if it's after hours and update the assignment group accordingly.
Is there a way I can query the schedules table and see if the current date/time falls within the schedule?
Thanks for all your help! I'm also open to other ways to accomplish this, but I figured schedules was a good place to start since it would handle time zones nicely.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 06:58 AM
Hi William,
Upon closer inspection, your schedRec.get() will likely not work. With one argument, this method is looking for a sys_id. You gave it a name. You should change it to:
if (!schedRec.get('name', 'Overnight Hours (Sogeti RIM)'))
return 'no';
As for the rest, I recomment testing it in scripts background to ensure your functionality before deploying it in a business rule, workflow script activity, etc.
This should help (I just made it last night because this comes up so often.)
Faster Server Side Script Development and Test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 07:15 AM
Thank you for the tip. I will definitely check out the video!
Now to toss this guy in a script include and call him from the record producer script!
Have a great Monday Chuck!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 07:19 AM
I am glad you got your question answered. Can you please mark the appropriate comment correct so others can find the answer quicker if they search for something similar in the future and it will be listed as "Answered". Thank you.