Edit

Share via


The SLA KPI instance doesn't reach Nearing Non-compliance or Non-compliant and the SLA KPI instance timer continues to run

This article provides a resolution for an issue where the service-level agreements (SLA) KPI instance doesn't reach the Nearing Non-compliance or Non-compliant state, and the SLA KPI instance timer continues to run in Microsoft Dynamics 365 Customer Service.

Symptoms

The flow runs created for the SLA KPI instances timer fail with the following license error message:

The user with SystermUserId = XXXX in OrganizationContext = YYYY is not licensed.

Cause

The SLAInstanceMonitoringWarningAndExpiryFlow is required to move the SLA KPI instances to a Nearing non-compliance or Non-complaint state. The flow always works in the context of the user who activates the first SLA in the organization. The user who activates the first SLA on the organization must have all the required licenses for the flow execution. The flow must only be turned off and on by a user who has the SLA KPI privileges at a global level for prvReadSLAKPIInstance and prvWriteSLAKPIInstance.

If the user is missing any of the required licenses, then the flow runs that are created for the corresponding SLA KPI instance will fail with a license required error "The user with SystermUserId = XXXX in OrganizationContext = YYYY is not licensed." Thus, the SLA KPI instance will never reach the Nearing non-compliance or Non-complaint state, and the SLA KPI instance timer will continue to run.

Additionally, the current owner of the flow must have the required permissions with read and write access for the SLA KPI instance.

Possible mitigation step 1: Change the owner of the flow

Tip

If a user who is the current owner of the flow needs to be removed from the organization, you should first change the owner of the flow to another user. This new user must also have all the required permissions. Once a new owner is added, you can delete the previous owner from the owner list. This action ensures the flow runs continue to be executed without issues.

To change the current owner of the failed flow, follow these steps:

  1. In Power Automate, navigate to Default solution > Cloud flows.
  2. Search for the failed flow with the error.
  3. Select Edit. A new flyout menu is displayed where you can set a new owner.
  4. In the Owner field, remove the current owner and add the new owner. Ensure the new owner has all required flow licenses.

Possible mitigation step 2: Turn off and turn on the static flow again

  1. In Power Automate, navigate to Default solution > Cloud flows.
  2. In Cloud flows, select SLAInstanceMonitoringWarningAndExpiryFlow.
  3. Even though its status is On, select Turn off and then Turn on.

This will fix the issue for new KPI instances.

For older KPI instances, you can change the status with your own logic or contact Microsoft Support for a script. Remember to provide the team with the affected record details and the required status of the SLA KPI instance.

Possible mitigation step 3: Rename and trigger the flow

Note

These steps should be performed by a Microsoft Entra user.

  1. In Power Automate, navigate to Default solution > Cloud flows.
  2. In Cloud flows, select SLAInstanceMonitoringWarningAndExpiryFlow.
  3. Verify that the flow isn't triggered.
  4. Update and save the flow with another name, and then turn it on. The flow starts to be executed.
  5. Verify that the instance of the above-created flow has been instantiated.

The status of the SLA will be updated successfully.

Screenshot that shows how to turn on or off a flow.

See also