In Servicenow , is it possible to track the date and time when the state of a task changed to a particular state, lets say "Pending" ? If yes, then how ?I have to find the pending age of a report

Chinmayee1
Giga Contributor

I have been given an activity to create a report and in that I need to find the Pending age of the cTask . I can find the datediff between sys_created_on and todays date but how do I find the pending age ? 

Please Advise.

Thanks in Advance

1 ACCEPTED SOLUTION

Tracy Davis
Giga Guru

You can create a db view, linking the task table to the metric_instance table (see below), make sure you do a left join on metric_instance table.

Then you can create the following report. The START and END times are the time stamps for each state of the CTASK.

The Duration field will tell you how long a task was in each state (and you could filter to just pending states if that's what you're after)

 

find_real_file.png

 

find_real_file.png

find_real_file.png

View solution in original post

3 REPLIES 3

harishdasari
Tera Guru

Hi Chinmayee,

In this case you have to create metrics to findout out the actual duration between the states.

If you create metrics it will calculate the duration for new CTASK after you configure the metrics.

 

Procedure to create metrics is click on definitions under metric. and write the logic here to calculate the duration.

find_real_file.png

 

Thank you.

Dubz
Mega Sage

You can use a metric to measure time spent in state. There are OOB metrics measuring incident state duration and problem state duration, you can use those as templates for your requirement (if you're measuring something other than incident or problem state).

Tracy Davis
Giga Guru

You can create a db view, linking the task table to the metric_instance table (see below), make sure you do a left join on metric_instance table.

Then you can create the following report. The START and END times are the time stamps for each state of the CTASK.

The Duration field will tell you how long a task was in each state (and you could filter to just pending states if that's what you're after)

 

find_real_file.png

 

find_real_file.png

find_real_file.png