How to Calculate overall time duration on case form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 02:22 AM - edited 01-31-2024 02:22 AM
Hi,
I have a requirement, I have a field called Time worked once I click to start play button beside the Time worked field the time should be run and once I close the case form it should stop the time automatically and the calculate overall time and added to the Time worked Tab.
I have tried a lot but not getting proper solution.
Can you please anyone suggest script for that. It will be helpful.
Thanks in Advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 02:30 AM
I tested this and it capture like this
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 02:37 AM
Thanks for responding!
I have tested already but Once I click to start play button beside the Time worked field the time should be running but once I click the close case button on form it should stop the time automatically and the calculate overall time and added to the Time worked Tab.
I need Script for that, can you provide me, It will be helpful.
Thanks!
Mania
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 02:45 AM
Hi @mania
I am not 100% , but I guess this timer start as soon as the case form get open. May be you need to add a condition on onload script if case is closed state it should not start.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 05:52 AM
Okay, I have one more query here.
1.when form is opened, Time worked field timer does not start, User can start timer if preferred - I have done this part.
2.If 00:00 time at any update - prompt user to add time manually before allowing ticket save
Time logged should go into time worked at bottom of ticket. - How to do this case?
In the above case how do i achieve that?, Can you help on this?, It will be helpful.
Thanks!
Mania