- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 09:34 AM
Hi all,
I have a requirement to measure a vendors SLAs and have come into a bit of a problem. the criteria is as follows
1. They have 2 sets of SLA hours: Core hours are 07:00 - 19:00 and have a 30 minute response SLA. 19:00 - 07:00 and have a 45 minute response SLA
2. They always the team that create the incidents so I need to build this on the basis on when we assign them the incidents.
When I assign them an incident, both SLAs attach but only 1 clock runs.
What I am trying to achieve is that the SLAs only get attached to the incident if the incident is assigned to them during the set hours. 07:00 - 19:00 OR 19:00 - 07:00
Has anyone done this? If so, how did you get this working and can you share it.
Thanks all for your help.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2016 05:45 AM
I tried this and it worked:
(function executeRule(current, previous /*null when async*/) {
var schedRec = new GlideRecord('cmn_schedule');
schedRec.get('name', '8-5 Weekdays');
gs.addInfoMessage('Checking against schedule: ' + schedRec.sys_id);
var sched = new GlideSchedule(schedRec.sys_id);
if(sched.isInSchedule(new GlideDateTime())){
gs.addInfoMessage('in schedule');
current.u_business_hours = 'true';
}else{
gs.addInfoMessage('not in schedule');
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2016 09:56 AM
No problem, glad it work.