Obtaining Time Spent Hours on Cases for an Entitlement (Dynamics 365 Customer Service)

The partner consultancy I run, SOLO Cloud Solutions, uses Dynamics 365 Customer Engagement as our internal CRM system to manage potential sales opportunities and customer caseloads. I’m a firm believer in “eating your own dog food” when it comes to the technology solutions our organisation supports and, by ensuring we use the very same tools we are proponents of to our end customers, we can best understand the benefits and, sometimes, frustrations that come with these systems and, all being well, appear credible to our end customers when recommending a particular solution to adopt. With this in mind, our business can benefit significantly on the one hand - by leveraging features such as Entitlements or SLA’s to ensure we can keep track and respond quickly to our customer’s needs - and, on occasion, grapple with issues and frustrations on the other hand. This reality doesn’t distract from my real favour for Dynamics 365 as a business solution; it’s just a natural expectation of any software system a business chooses to adopt. 😉
To illustrate this point more plainly, let me share a real frustration we faced involving the system and how we got around it. For some of our customers, we track the number of hours we consume on each Case via an Entitlement. These Cases can cover two types of issues:
- Break/Fix where the solution isn’t working due to a fault on our side or via Microsoft. Our support agents will typically pick these up and work through to resolution.
- Enhancement or change requests requiring a modification to an existing solution. In all cases, these will be passed along to an appropriate consultant (maybe even me!) to progress and implement accordingly.
Under the support agreements, we do not typically deduct/consume hours for issues where the system has broken. As we have dedicated colleagues to handle support issues, this is “soaked up” as part of our support agreement. We only then need to potentially charge, track and (potentially) invoice the customer for work that sits outside of this and, typically, requires the expertise of a trained consultant to satisfy. So, for the latter scenario, colleagues logging Cases in the system need to press the appropriate Do Not Decrement Entitlement button to ensure hours are not deducted from the Entitlement:
So far, so good - all of this is native functionality in the application and an absolute doddle to set up. Things start getting a bit trickier when we need to report back to customers on how we’ve consumed hours for both scenarios. Scenario 2) presents little difficulty in obtaining, but 1) proves, as far as I know (answers on a postcard if you disagree), more irksome generate. However, as they say, where there is a will, there’s a way. 😁 Using a bit of FetchXML wizardry, we can look to construct a query similar to the one below to generate the information we need for both scenarios, with a clear flag field to indicate whether the hours fit into scenario 1) or 2):
<fetch aggregate="true">
<entity name="incidentresolution">
<attribute name="totaltimespent" alias="incidentresolutionsum" aggregate="max" />
<link-entity name="activitypointer" from="activityid" to="activityid" link-type="inner">
<link-entity name="incident" from="incidentid" to="regardingobjectid" link-type="inner" alias="incident">
<attribute name="incidentid" alias="incidentid" groupby="true" />
<attribute name="decremententitlementterm" alias="decremententitlementterm" groupby="true" />
<filter>
<condition attribute="entitlementid" operator="eq" value="094b0dcc-df24-ec11-b6e6-000d3a0cb337">
<value>094b0dcc-df24-ec11-b6e6-000d3a0cb337</value>
</condition>
</filter>
</link-entity>
</link-entity>
</entity>
</fetch>
Using arguably the best XrmToolBox app, we can then get a result back that looks like this:
From there, we can then sum up all of the True values to determine the hours consumed for scenario 2); everything else will be a break/fix issue.
Now, there’s a couple of things to remember with this solution:
- You will need to update the value used in the entitlementid condition to match your environment and Entitlement…in case that wasn’t obvious. 😀
- It’s expected we always associate a Case to an appropriate Entitlement for the customer. This has the benefit of ensuring that we can always tag the correct SLA. For reporting purposes, this also provides a common attribute for us to filter on for each period we are concerned with (for us, we typically have an Entitlement per calendar quarter for each customer).
- Our primary table used is the incidentresolution table, which indicates we’ve resolved the Case. We then implement grouping and aggregation to return the maximum totaltimespent value from this, representing the actual amount of time spent on the Case and accounting for any scenarios where the Case may have been re-opened.
- For this approach to work, we instruct our agents to raise and close Tasks, via the Timeline control, on the Case row for all actions they perform, recording the amount of time it takes to complete each one in the process. This ensures that the time rolls up correctly when the Case is closed.
But apart from that, this solution works well for our purposes and makes it quick and easy to generate the information we need during our quarterly reviews with customers. As stated, it’s a shame that we have to revert to a more complex query to get this information, but I’m willing to admit that our particular scenario may be somewhat niche. Hopefully, if you’ve found yourself in the same boat from a requirements standpoint, then this approach will help you as well. And it goes a long way to proving the point over the potential versatility of the Dynamics 365 Customer Service application. Provided, of course, you know what you’re doing… 😅
Published on:
Learn moreRelated posts
Dynamics 365 Customer Service – Use Assign option for cases to update capacity, presence
We are announcing the ability to use the Assign option on the case form to work with unified routing to update presence and capacity of servic...
Dynamics 365 Customer Service – Intent-based suggestions has been disabled
Due to reports of unintended token consumption in the Copilot Service workspace app, we have modified the default state of intent-based to be ...
Sales Collaboration: How Sales Teams Work in Dynamics 365 CE
A Sales Team in Microsoft Dynamics 365 Sales represents a group of users who collaborate to manage and close sales opportunities efficiently. ...
Environment Variables vs Configuration Tables vs Hardcoding in Dynamics 365 Customer Engagement (CE)
In Dynamics 365 Customer Engagement (CE), managing configuration values effectively is key to building scalable and maintainable solutions. En...
Use custom productivity tools in Dynamics 365 Customer Service
As customer service teams strive to deliver faster, more personalized support, the need for tailored productivity enhancements has never been ...
Dynamics 365 Customer Service – Connect AI agents using Model Context Protocol server – updated date
We are announcing the ability to connect to AI agents through the Model Context Protocol server in Dynamics 365 Customer Service. This feature...
Try the AI agent activity feed in Dynamics 365 Customer Service
Contact centers are increasingly adopting AI agents as part of their journey to become autonomous. During this time of rap...
Dynamics 365 Customer Service – New timeout rules logic for Representative Non-Response time and open state conversation
We are announcing new timeout rules logic for Representative Non-Response Time and open state conversations in Dynamics 365 Customer Service. ...
Dynamics 365 Customer Service – Automate case lifecycle tasks with Case Management Agent
We are announcing the ability to automate case lifecycle tasks with Case Management Agent, which automates case creation and updates, facilita...
Dynamics 365 Customer Service – Perform bulk actions on filtered conversations
We are announcing the ability to perform bulk actions on filtered conversations in Dynamics 365 Customer Service. This feature will reach gene...