Select Page

A new knowledge base article has been published on our support portal.

## Overview

In this scenario the requirement is to assign Dynamics 365 case priorities dynamically on the creation of the case which are being brought in from an external system. The case with the highest priority should be the next handled by their customer service agents.

When the case is created, it’s location in the queue of cases pending review needs to be calculated and then a case priority value assigned to it.

There are 3 rules, if a case meets the requirements for Rule 1, then it is applied. Else, if it meets the requirements for Rule 2, then that is applied, otherwise apply Rule 3.

Rule 1 cases have a higher priority than Rule 2.

Rule 2 cases have a higher priority than Rule 3.

### Rules

Priority Rule 1: Priority A 10 day counter is not blank

Priority Rule 2: Priority B 90 day counter is not blank and value is less than or equal to 50

Priority Rule 3: Cases where Priority B 90 day counter is greater than 50 days

For each of the various rules, the internal ordering of the cases in that range should follow these rules:

• Rank incidents based on the number in the Priority A 10 day counter or Priority B 90 day counter field, where the lesser the number, the higher the ranking priority
• If multiple incidents exist with the same number of days, select the one with the highest monetary value (Euro amount)
• If multiple incidents exist with the same number of days and Euro amount, select the one with the earliest date of submission

The solution that we used here was to use a decimal numeric range for the Case Priority.

• Priority Rule 1 cases would have a rating between 2 and 3
• Priority Rule 2 cases would have a rating between 1 and 2
• Priority Rule 3 cases would have a rating between 0 and 1

The higher the rating, the more important the case.

For each case that comes in, we identity its position in the queue, then determine the rating of the case before and after it, add them together, half them and assign that rating to the new case.

### Worked Example

The maximum value for a Rule 1 case is 3, the minimum value is 2.

1. When the first Rule 1 case is created, it identifies that it is the only case, so it takes the max and min, adds them together (2 + 3) = 5 and halves the value: 5/2 = 2.5
2. When the next case comes in, if it has a lower priority than the first case in Rule 1, then its priority will be the difference between the minimum value and the case after it: ( 2 + 2.5 ) / 2 = 2.25
3. The next case is less important than the first case, but more important than the second case, so its priority will be (2.25 + 2.5)/2 = 2.375

So now we have three cases in Rule 1, with this ranking in the queue.

Prioritized Queue Priority
Case 1 2.5
Case 3 2.375
Case 2 2.25

When a new case that is more important than Case 1, it’s rating with be (2.5+3)/2 = 2.75 and is now the top of the queue.

Prioritized Queue Priority
Case 4 2.75
Case 1 2.5
Case 3 2.375
Case 2 2.25

By using decimals we can assign the priority each time without having to alter the ratings for other cases in that rule.

## North52 BPA Solution

The North52 BPA solution works like this:

• A server-side Formula is created on the Case entity that will carry out the following steps:
• Determine if the Prioritization rule should fire
• Identify which Priority Rule to apply
• Set the applicable minimum and maximum ranges for the Priority Rating
• Identify all other Cases that are affected by that rule
• Calculate the Priority of the current Case and set it