How to start or pause or stop a timer field through a script?

harsha328
Tera Contributor

Hello,

I am trying to calculate the time an incident is in a particular state. I have added a timer field to the incident record. The timer should start running if the state of incident is either 'awaiting evidence' or 'awaiting user info' and should be paused if it's neither of the formerly mentioned states. My idea is to do this using a business rule, but I have no idea of how to start or pause a timer field through a script.

How do I achieve this?

Thanks in Advance,

Harsha

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,



You can have a metric definition it will give you for how many time it was in one of the state.



See Metric definition, there are some OOB definitions available for this purpose


View solution in original post

10 REPLIES 10

I Have replied you based on to calculate time your ticket is in one of the state.



Not for pause and play.



If you want to have Exact time your ticket was in work in progress then go for Metric option


Hi Ashutosh,


The way you have suggested works too. There is an OOB Metric definition that stores the duration that an incident is in a particular state. But it doesn't have a field that shows, to which Incident the metric is created for.


Yes it gives you a number of incident.


Thanks Ausotosh. I think I can use the way you have suggested to meet my requirements.


Welcome Harsha,



Don't forget to Click:


Hit Helpful or Correct