The CreatorCon Call for Content is officially open! Get started here.

How to Calculate overall time duration on case form

mania
Tera Contributor

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.

 

mania_0-1706696466433.png

mania_3-1706696502254.png

Thanks in Advance!

7 REPLIES 7

Dr Atul G- LNG
Tera Patron
Tera Patron

I tested this and it capture like this

LearnNGrowAtul_0-1706697044457.png

 

*************************************************************************************************************
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]

****************************************************************************************************************

@Dr Atul G- LNG 

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

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]

****************************************************************************************************************

@Dr Atul G- LNG 

 

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