How to keep running total of hours for a ticket.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2024 10:56 AM
I have created two fields on Incident table:
Time Spent (Value in minutes of time spent working on this item for current update)
Total Time Spent (Sum of all Time Spent entries on the ticket)
I need assistance with writing the business rule that updates the Total Time Spent field every time the Time Spent field is updated with a new value. This will allow us to calculate the total time spent on the ticket so we can compare it with the originally estimated level of effort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2024 11:39 AM
You can use a simple business rule to increment the Total Time Spent field when the Time Spent field is updated. Be sure to select the time spent field is the condition for your onChange business rule and use this
var timeSpent = parseFloat(current.u_time_spent) || 0;
var totalTimeSpent = parseFloat(current.u_total_time_spent) || 0;
var newTotal = timeSpent + totalTimeSpent;
Please mark helpful and solution provided if this meets your needs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 11:05 AM
Thanks for your assistance with this.
Unfortunately, the Total Time Spent field does not get updated when this rule is running.
My conditions are: Before Update when Time Spent Changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 09:58 AM
@christopher_cox still need assistance with this request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 10:07 AM
Hi @Elizabeth Barlo ,
There is other way to do that if incident has SLA configured, the SLA has actual and business time, you can copy that value on any new field ( same type ) on incident form based on applied logic ot based on INC state.
let me know if i understood requirement correctly.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution