Reassignments of WOs on pending review state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2025 08:06 PM
Requirement: When WOs are being reassigned every morning, kindly include those that were put in pending review past 5pm the previous day.
Can anyone help update the scheduled job for above requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 03:52 AM
For this, I was planning to introduce this and wanted to check with if this will work:
// Get yesterday's date in Nairobi timevar yesterdayNairobi = _getBeginningDateTime('Africa/Nairobi'); yesterdayNairobi.addDaysUTC(-1); // Subtract one day from yesterday in Nairobi time// Get WOs put in pending review after 5 PM yesterday in Nairobi timevar owot = new GlideRecord('wm_task'); owot.addEncodedQuery("state=pending_review^created_on>=@javascript:gs.dateGenerate('Africa/Nairobi','" + yesterdayNairobi.getDisplayValue() + " 17:00:00');@javascript:gs.dateGenerate('Africa/Nairobi','" + yesterdayNairobi.getDisplayValue() + " 17:00:00');"); owot.query();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 09:38 AM
Hello, you need to update the scheduled job to include Work Orders (WOs) that were put in Pending Review past 5 PM the previous day
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 09:39 AM
Add a new query to fetch Pending Review WOs updated past 5 PM yesterday.
Convert the sys_updated_on
field to Africa/Nairobi timezone to check the hour.
If a WO was moved to Pending Review after 5 PM, it gets re-assigned in the morning.
Keep existing logic for reassigning WOs from dispatchers on leave.