- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 06:04 AM
Hi All,
In the entitlement I have chosen unit type as Hours and I need to deduct the timeworked on case from the total units and reflect the remaining total time in remaining units field on the entitlement. Do we have any OOB code or functionality existing for it.
Can anyone help me on above usecase.
Thanks,
Jaydee
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2023 01:10 AM
As documentation says you need to develop a custom business rule to support this.
To use hours as the unit type, customers must create a separate business rule. For example, create a rule that is applied to the amount of time an agent spends on a case. When a case is resolved, deduct the hours spent from the total service hours available in the entitlement.
Not sure if it's correct to deduct time when case is resolved, I guess better to create a business rule on time_card_daily table (if you are using OOB time tracking system), and when time_card_daily added (it happens when time card approved only) then we will decrease remaining hours for current.time_card.task(case).entitlement. But here we shouldn't forgot about Recall functionality which is deleting time_card_daily records when it's recalled, so handle this in your business rule too, basically if operation is delete - go and add remaining units back to that entitlement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 08:30 AM
Hi @Jaydee1 ,
"Per Unit" checkbox should be checked to update "Remaining Units" (Cases). System updates Entitlement record upon Case closure. Please take a look at the business rule "Update case entitlement on Close" for more details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 09:12 PM
Hi @Community Alums ,
This only works if unit type of entitlement is case we have following condition in the BR:
if(entitlement.get(current.entitlement) && entitlement.getValue("per_unit") == 1 && entitlement.getValue("unit") == "cases")
I have chosen unit type as hours and I need to reduce hours to show case the correct remaining time.
Thanks,
Jaydee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2023 01:10 AM
As documentation says you need to develop a custom business rule to support this.
To use hours as the unit type, customers must create a separate business rule. For example, create a rule that is applied to the amount of time an agent spends on a case. When a case is resolved, deduct the hours spent from the total service hours available in the entitlement.
Not sure if it's correct to deduct time when case is resolved, I guess better to create a business rule on time_card_daily table (if you are using OOB time tracking system), and when time_card_daily added (it happens when time card approved only) then we will decrease remaining hours for current.time_card.task(case).entitlement. But here we shouldn't forgot about Recall functionality which is deleting time_card_daily records when it's recalled, so handle this in your business rule too, basically if operation is delete - go and add remaining units back to that entitlement