How to set up SLAs in Dynamics 365: a complete guide
How to set up SLAs in Dynamics 365 Customer Service, from business hours and SLA KPIs to showing deadlines on the case, views for the team lead, testing and deploying to production.
SLAs (service-level agreements) in Dynamics 365 Customer Service make the deadlines on a case visible. The agent sees how much time is left, the system warns before a deadline is missed, and you get data on how long it actually takes to respond to and resolve cases.
The configuration itself is well documented, but many guides stop once the SLA is activated. This guide aims to give a complete introduction: how SLAs are built, how to set them up, how the deadlines are shown to users, and what to keep in mind when the solution is deployed to production.
What is an SLA in Dynamics 365?
- An SLA is a set of agreed deadlines on a record, usually a case (
incident). - Each deadline is an SLA KPI, for example First Response By and Resolve By.
- When a case hits an SLA, one SLA KPI Instance is created per deadline. The instance is the timer itself, with a status and timestamps.
- Deadlines are counted in business hours, based on opening hours and holidays.
Modern SLAs are configured in the Copilot Service admin center (formerly Customer Service admin center). The old “Standard” and “Enhanced” SLAs from the web client are legacy. If you find a guide that shows them, it’s out of date.
Before you start
The technical setup is quick once you know what to set up. Have answers to these questions before you begin:
- Business hours and holidays: when the clock should run.
- Which deadlines to measure, and how long each one is, in working days or business hours.
- Which cases should get an SLA, for example only certain channels or case types.
- What stops each deadline, for example that the first response has been sent or that the case is resolved.
- Which status reasons pause the clock, for example when you’re waiting for the customer.
You need the Customer Service Manager, System Customizer or System Administrator role to set up SLAs.
The data model
It helps to understand which tables are involved. Some you set up yourself, while others are created automatically for each case.
Configuration
| Table | Logical name | Role |
|---|---|---|
| Holiday schedule | calendar |
Holidays and closed days |
| Customer service schedule | calendar |
Business hours. Points to a holiday schedule. |
| SLA KPI | msdyn_slakpi |
What is measured, and from when |
| SLA | sla |
Groups the rules for one table |
| SLA Item | slaitem |
One rule: when it applies, what counts as success, warn, fail, pause and actions |
Both the holiday schedule and the customer service schedule live in the calendar table.
Important fields on the SLA KPI (msdyn_slakpi):
msdyn_entityname: the table being measured, usually Casemsdyn_kpifield: the lookup field on the case that should point to the instancemsdyn_applicablefromfield: the field the deadline is counted from, usually Created On
Runtime
| Table | Logical name | Role |
|---|---|---|
| SLA KPI Instance | slakpiinstance |
One per deadline per case. The timer itself. |
| Case | incident |
The record being measured |
These fields on the case are the ones you’ll use most:
firstresponsebykpiidandresolvebykpiid: lookups to the instancesfirstresponsesent: whether the first response has been sentslaid: the SLA that applies to the caseonholdtime: the total time the case has been paused
Two things are worth understanding:
msdyn_kpifieldis the link between the KPI and the case. The field decides which lookup field on the case gets filled with the instance.- Never set the lookup fields on the case manually. If you click into them, you see every SLA KPI instance in the system, not just the case’s own.
The setup order
Each step builds on the previous one, so the order matters.
- Foundation
- Holiday schedule
- Customer service schedule
- Service configuration
- Rules
- SLA KPIs
- SLA
- SLA items
- Actions (optional)
- Activation and default
- The monitoring flow
- Presentation
- Security roles
- Case form
- Views and dashboards
- Go live
- Test
- Deploy
Configuration step by step
The example uses a fictional energy company, Contoso Utilities, open Monday to Friday from 08:00 to 16:00 (8 hours a day).
1. Holiday schedule
Go to Copilot Service admin center → Operations → Calendar → Holiday schedule.
Create, for example, “Contoso Holidays” and add the public holidays and any other days the contact center is closed.
2. Customer service schedule
The customer service schedule holds the opening hours, also called business hours. Create, for example, “Contoso Business Hours” with the opening hours and the holiday schedule from step 1.
Without business hours, the clock runs around the clock, every day. All durations are calculated from the business hours, so if the opening hours change, the warn and fail durations have to be recalculated.
3. Service configuration settings
Go to Operations → Service terms → Other SLA settings → Manage.
- Select SLA Pause Status: Choose Case, and move the status reasons that should pause the clock over to Selected, for example “Waiting for customer”.
- Calendar Export and Import: Turn on Enable calendar export and import in every environment. The holiday schedule and customer service schedule then travel with the SLA when the solution is exported and imported. It’s off by default.
- Recalculate SLA on terminal status: Off by default, which means a deadline that has reached a terminal status (Succeeded, Noncompliant or Canceled) isn’t evaluated again, even if the case changes. If you turn it on, the deadline is recalculated when the case changes so that the conditions no longer hold, for example when a resolved case is reopened. The old instance is canceled and a new one is created. But the new deadline is still counted from Applicable From, usually Created On. If the deadline has already passed, the new instance is Noncompliant right away. A deadline that is Noncompliant stays Noncompliant.
Pausing can be set at three levels. The most specific level with its own conditions wins:
- SLA itemOverride Criteria on the item
- SLA KPIOverride Criteria on the KPI
- TableService configuration settings
4. SLA KPIs
Go to Operations → Service terms → SLA KPIs → Manage, and create one KPI per deadline:
| Name | Entity Name | KPI Field | Applicable From |
|---|---|---|---|
| First Response By | Case | First Response By KPI | Created On |
| Resolve By | Case | Resolve By KPI | Created On |
Activate the KPIs. They can’t be used in an SLA item until they’re active.
5. SLA
Go to Service terms → Service Level Agreements (SLAs) → Manage → New. Give the SLA a name, for example “Contoso Standard SLA”, and choose Case as the Primary Entity. Business hours aren’t set here, but on each SLA item.
Save. The SLA items section then appears. One SLA can have many KPIs, with one or more items per KPI.
6. SLA items
An SLA item is one rule. The form has these parts:
- General: name, KPI, Allow Pause and Resume and Business Hours. Allow Custom Time Calculation is only used if you want to calculate the time yourself with a plugin.
- Applicable When: when the rule applies.
- Success Conditions: what stops the clock as met.
- Pause Configurations: pause conditions of its own. Only shown when Allow Pause and Resume is on.
- Warn and Fail Duration: when the deadline is approaching, and when it’s missed.
- Actions: Configure Actions (see the next step).
Applicable When
Typical conditions are:
- Origin (
caseorigincode), if only some channels should have an SLA - Parent Case (
parentcaseid) does not contain data, so child cases don’t get deadlines of their own - Created On (
createdon) on or after the go-live date, so existing cases don’t get a deadline that has already been missed
Applicable When is checked again every time the case is updated. If the case stops matching, the instance is canceled. So avoid fields that change often.
Success Conditions
- First Response By: First Response Sent (
firstresponsesent) = Yes - Resolve By: Status (
statecode) = Resolved
Don’t add Canceled to the success conditions. Canceled cases would then count as met. Canceled cases are handled automatically.
firstresponsesent isn’t set automatically when an email is sent. The agent or a flow has to mark it.
Warn and Fail Duration
Warn and fail are fixed durations in business hours, not a percentage of the deadline. With an 8-hour working day, it can look like this:
| SLA item | Warn after | Fail after |
|---|---|---|
| First Response | 3 hours | 4 hours (half a working day) |
| Resolve | 16 hours (2 working days) | 24 hours (3 working days) |
The calculation is working days × hours per working day. Three working days is 3 × 8 = 24 business hours.
Hours turn into days
Enter the duration in hours, for example “24 hours”. When the value is 24 hours or more, the field automatically shows it in days. 24 hours is then shown as “1 day”.
This is where many people slip up. 1 day in the field is 24 business hours, not one working day. If you enter “3 days” because the deadline is three working days, the case gets 72 business hours, which is nine working days with an 8-hour day.
Only the first match counts
For each KPI, only the first SLA item whose Applicable When matches is used. If you want a shorter deadline for high-priority cases, you need a separate item for it. Add a condition to the standard rule that excludes high priority, so each case can only match one item. Then the order doesn’t matter.
Case: Origin = Email, Priority = High
- Wrong: overlapping conditions
- 1. Standard
Origin = EmailMatches, used - 2. High priority
Priority = HighNever used
- 1. Standard
- Right: mutually exclusive
- 1. Standard
Origin = Email and Priority ≠ HighDoesn't match - 2. High priority
Priority = HighMatches, used
- 1. Standard
Changes
The SLA has to be deactivated before its items can be edited (“Deactivate SLA in order to edit SLA item”), and the KPI on an item is locked after saving. Changes only apply to new cases and cases that are updated.
7. Actions (optional)
Actions can only be set up once the SLA item has been saved. The Configure Actions button then appears at the bottom of the item.
When you click the button, a flow is created for the item and opened in Power Automate. The flow is called ServiceLevelAgreement_ActionFlow_ followed by a GUID. It runs when an SLA KPI Instance changes, and has a Switch on the status with three branches:
- Is Near Non Compliance: the deadline is approaching (Warning Time has passed)
- Is Succeeded: the deadline was met
- Is Non-compliant: the deadline was missed
Add your actions with Add an action inside the branches. Leave everything marked “Do not delete or update” alone.
A typical use is notifying the case owner by email or Teams when the deadline is approaching or has been missed. Make sure the flow is part of your solution (see Deploy).
8. Activation and default
Select Activate on the SLA, and then Set As Default. It’s then used on all new cases that match. You can also link SLAs to cases through entitlements, or set them from a flow, but for most setups the default is enough.
An active SLA is read-only, both the SLA and its items. To change anything, you have to select Deactivate first.
9. The monitoring flow
The system flow SLAInstance
10. Security roles
- Agents need organization-level read access to SLA, SLA KPI and SLA KPI Instance. The owner of an instance isn’t necessarily the owner of the case, so access to own records only can make the deadlines disappear for whoever has the case.
- The monitoring flow and the action flows must be owned by a user with organization-level read and write access to SLA KPI Instance.
SLA KPI Instance status and fields
| Status | Meaning |
|---|---|
| In Progress | The clock is running |
| Nearing Noncompliance | Warning Time has passed |
| Noncompliant | The deadline was missed |
| Paused | The case has a status reason that pauses |
| Succeeded | The success condition is met |
| Canceled | The case was canceled, or the rule no longer applies |
The fields worth knowing:
- Failure Time and Warning Time: the actual timestamps, calculated from the business hours. They move forward when the case has been paused.
- Succeeded On: when the deadline was met.
- Active Duration (min): the business time it took before the instance reached a terminal status. Useful when you adjust the deadlines after go-live.
- Elapsed Time (min): the time the instance has been paused.
There is no field for “time remaining”. Use Failure Time together with Status. The timer on the form shows clock time until the deadline, not business time:
Showing the SLA on the case
Agents need to see the deadlines where they work, on the case. For that you use the SLA Timer control.
SLA Timer on a subgrid
SLA Timer shows all the deadlines for the case in one card, with a ring and the time remaining. It also shows history, for example a new Resolve By after the case has been reopened.
It can be done in the modern form designer:
- Open the case form in make.powerapps.com and add a Subgrid where the card should go.
- Check Show related records, and choose SLA KPI Instances (Regarding) as the Table and All SLA KPI Instances as the Default view.
- Under Components, select + Component and add SLA Timer.
- Save and publish.
The view the subgrid uses controls which KPIs are shown. Place the card near Status Reason and First Response Sent, so the agent has everything that affects the deadlines in one place.
Click SLA Timer under Components to open its settings:
- Update frequency: how often the timer refreshes. Don’t choose too short an interval, for performance reasons.
- Turn on negative countdown: set it to Yes, so the timer shows in red how far past the deadline the case is.
Look at the times. The 4-business-hour deadline doesn’t start until the contact center opens at 08:00 on Thursday, so it’s due at 12:00. Even so, the timer shows 15 hours and 22 minutes, because it counts clock time until the deadline. The same goes for Resolve By: 24 business hours becomes three working days, with a deadline on Monday at 16:00, and the timer shows 4 days and 19 hours.
The icon and text change with the status. The ring fills up as time passes, an orange warning sign shows that the deadline is approaching, a red exclamation mark shows that it was missed, and a green check shows that it was met. A blue pause sign shows that the clock is stopped. With negative countdown, the time past the deadline is shown in red.
The timer refreshes by itself on pause and resume. For other status changes, the user has to refresh the page to see the new status.
Views and dashboards
Build working views on Case, with filters and columns through the KPI lookups. That way owner, team and queue work as usual. Build reporting views on SLA KPI Instance.
Views on Case
In the view designer, add related columns and filters through Resolve By KPI and First Response By KPI. Some examples:
| View | Filter |
|---|---|
| My cases near deadline | Owner = Current User, Resolve By KPI → Status = Nearing Noncompliance |
| My cases past deadline | Owner = Current User, Resolve By KPI → Status = Noncompliant |
| No first response | First Response By KPI → Status = In Progress |
| Team cases at risk | Status = Nearing Noncompliance or Noncompliant, with Owner as a column |
Sort by Failure Time ascending, so the case with the least time left ends up on top. Relative date filters on Failure Time, such as Today and Next X Hours, also work well.
Views and charts on SLA KPI Instance
- Breaches this month: Status = Noncompliant and Failure Time this month, grouped by KPI.
- Chart: count per Status and per KPI.
Dashboard for the team lead
Combine the views on Case with the charts on SLA KPI Instance in a dashboard. Trends over time, by channel, case type and Active Duration, are a better fit for Power BI.
- Agent
- SLA Timer on the case
- My cases near and past deadline
- Team lead
- Team cases at risk
- Dashboard with status per KPI
- Management
- Power BI
- Trends and Active Duration over time
Test
Create a separate test SLA with short durations, for example a 5-minute warn and a 10-minute fail. That way you see the status changes without waiting for days. The monitoring flow can take a few minutes to update the status.
| Scenario | Expected |
|---|---|
| New matching case | One instance per deadline in In Progress, lookups filled |
| Case outside Applicable When | No instances |
| Created after closing time | The deadline counts from the next opening time |
| Before a holiday | The holiday isn’t counted |
| Warning Time passed | Nearing Noncompliance |
| Failure Time passed | Noncompliant |
| First response marked | First Response By = Succeeded |
| Case resolved | Resolve By = Succeeded |
| Paused and resumed | Paused, then In Progress with a moved deadline |
| Case canceled | Canceled |
| Case reopened | Without Recalculate: Resolve By stays Succeeded. With Recalculate: a new instance, with the deadline counted from Created On |
| Agent role only | Sees the deadlines and can save the case |
Deploying to production
Not everything travels with the solution. Add what can be added, and check the rest manually in each environment after import.
- Travels with the solution
- SLA with SLA items
- The SLA KPIs, as required components
- The calendars, if "Enable calendar export and import" is on
- The action flows, if they're in the solution
- Forms, views, charts and dashboards
- Security roles
- Check after import
- The SLA is activated
- The SLA is set as default
- The pause settings are set
- The monitoring flow is on
- The action flows are on
- The calendars are correct
- A test case gets instances
Before you export
- Add the SLA with Add existing → Rules → SLA, and choose to include required components. The SLA items and SLA KPIs then come along.
- Check that the action flows are included. They’re called
ServiceLevelAgreement_ActionFlow_followed by a GUID. If they’re missing, add them yourself. - Turn on “Enable calendar export and import” in both the source and the target environment. The holiday schedule and customer service schedule then travel with the SLA. The calendars in the target environment are overwritten on import, so make calendar changes in the development environment.
On import
- Deactivate the SLA in the target environment first, if it already exists there. Otherwise the import fails, or the SLA is set back to Draft.
- After import, the SLA is in Draft. Activate it, and set it as default again.
- Service Configuration Settings don’t travel with the solution. They’re environment settings, so the pause statuses, calendar export and Recalculate have to be set in each environment.
Make changes to the SLA in the development environment, and deploy them with the solution. If you change the SLA or its items directly in production, the changes end up in a separate layer on top, and later upgrades of the solution don’t come through. Changes only apply to new cases and cases that are updated.
Troubleshooting
- The lookup on the case is empty, but the instance exists: Check KPI Field on the KPI and Regarding on the instance.
- The status never becomes Nearing Noncompliance or Noncompliant: The monitoring flow is off. The timer then shows the message “The SLA instances might be incorrect because workflow … is turned off”.
- The timer shows much more time than the business time left: The timer shows clock time until the deadline.
- The deadline is far too long: The duration was entered in days instead of hours.
- The exception is never used: Another SLA item matches first.
- You can’t edit the SLA item: The SLA has to be deactivated.
- Old cases get breaches: Created On on or after go-live is missing from Applicable When.
- The instance was Canceled in the middle of the case: The case no longer matches Applicable When.
Start simple
Start with one standard rule per deadline and few exceptions. Let the system collect data in Active Duration for a few weeks, and adjust the deadlines to what you actually see. Once the foundation is in place, natural next steps are marking the first response automatically with a flow, sending notifications through actions and following the trends in Power BI.