CSM Entitlement

Jaydee1
Tera Guru

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

1 ACCEPTED SOLUTION

Ihor
Giga Expert

As documentation says you need to develop a custom business rule to support this.

https://docs.servicenow.com/en-US/bundle/tokyo-customer-service-management/page/product/customer-ser...

 

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 

View solution in original post

3 REPLIES 3

Community Alums
Not applicable

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.

 

Jaydee1
Tera Guru

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

 

Ihor
Giga Expert

As documentation says you need to develop a custom business rule to support this.

https://docs.servicenow.com/en-US/bundle/tokyo-customer-service-management/page/product/customer-ser...

 

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