Symptoms
SLA Targets have been defined for Tickets such that they are based on the service that got affected owing to the Incident. The Service CIs have availability schedules defined for example Monday to Friday 9AM to 5PM.
Tickets are related to the Affected Service and the SLA monitoring commences. However when the SLA targets are actually applied to Tickets then the SLA monitoring calculates the SLA over a 24X7 period. It does not pause the calculations for the time that the Service CI is not available.
Solution
?0 0 0 25 JAN,MAR,MAY,JUL,SEP,NOV ?
(The question mark at the end of the expression is a requirement and not a typo)
EXEC p_generate_ci_service_schedule ${slice},-1;UPDATE v SET v.sla_due_date=dbo.F_GET_SLA_DEADLINE (m.slice, q.item_id, q.agreement_id, 'Service', q.affected_ci_id, CONVERT(INT, t.threshold_value), m.timer_start_date) FROM sla_agreement_compliance AS v WITH (ROWLOCK) INNER JOIN sla_qualifying_items AS q WITH (NOLOCK) ON v.slice = q.slice AND v.qualifier_id = q.row_id INNER JOIN vsla_agreement_threshold AS t WITH (NOLOCK) ON v.slice = t.slice AND v.threshold_id = t.row_id INNER JOIN sla_metric_calculations AS m WITH (NOLOCK) ON q.slice = m.slice AND q.metric_id = m.metric_id AND v.measurement_id = m.row_id INNER JOIN dbo.sla_metrics AS s WITH (NOLOCK) ON s.slice = t.slice AND s.row_id = t.metric_id WHERE v.slice=${slice} AND s.metric_service_period_code=2 AND v.compliance_status_code IN (0,3);