Entitlements in CSM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2023 08:37 AM
Hello All,
In the entitlement, I have selected unit type as hours. I need to subtract the time worked on the case from the total units and show the remaining time in the remaining units field of the entitlement. Can anyone provide me with a Business Rule to update the remaining time automatically based on the time the agent worked on the case?
PS: I checked the product documentation, it says to write a BR for hours unit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2023 11:45 AM
Hi @swapnil15,
Write business rule and change script according to your requirements like To deduct hours worked from the total service hours available in the entitlement when a time card is added (approved) and to handle the recall functionality, you should create a Business Rule on the time_card_daily table.
var caseTask = current.task;
if (caseTask && caseTask.entitlement) {
var entitlement = new GlideRecord('sn_customerservice_entitlement'); //entitlement table name
if (entitlement.get(caseTask.entitlement)) {
var remainingUnits = entitlement.remaining_units || 0;
var hoursWorked = current.hours;
entitlement.remaining_units = remainingUnits + hoursWorked;
entitlement.update();
}
}
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2023 02:20 AM
Hello Anand,
Thanks for your response.
Pardon, if I am asking basic questions, as I am new to this module.
1. Can you tell me more about the time_card_daily table. How is this table related to entitlements? I cant see any record on time card daily table.
2. What is recall functionality?
3. What should be the condition on BR to execute? (Presuming a user updates the case or closes the case)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2023 03:58 AM
Hi @swapnil15 ,
1)The time_card_daily table in ServiceNow is typically used for tracking daily time card entries. Time cards are used to record hours worked or tasks performed by employees, contractors, or service personnel. These records are typically associated with some form of entitlement or work order, such as cases, incidents, or service requests.
2)Recall functionality, service management systems, typically refers to the ability to withdraw or cancel a previously submitted record.
3)After insert br when record inserted take reference below sreenshort
Thanks,
Anand