Track Total Time a Vulnerability Spends in Deferred State

rohitgotefode3
Tera Contributor

Hello ServiceNow Experts,

I need to track the total time a Vulnerability spends in the Deferred state and store this value in a custom field (u_time_in_deferred).

Requirements:

  1. When a Vulnerability enters the Deferred state, capture the timestamp.

  2. When it moves out of Deferred, calculate the time spent and add it to the custom field (u_time_in_deferred).

  3. The field should accumulate the total time even if the Vulnerability moves in and out of Deferred multiple times.

I appreciate any guidance, suggestions, or alternative approaches. Thanks in advance.

Regards,
Rohit Gotefode

 

 

1 REPLY 1

Mark Manders
Mega Patron

Normally, metrics would do, but the table can't be selected. I think you could use 2 fields: fill the 'start' when it's set to deferred and the 'end' when it is set to a different state. As soon as 'end' end is filled, calculate the difference and add it to the 'time in deferred' field, while at the same time, emptying the other 2 fields for new calculation.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark