How can I determine when an SCTASK is assigned?

Luis Roman
Kilo Guru

I have search different tables and variables to be able to determine "How to determine the date and time for the assignment of an SCTASK" in Service Central. However, have not been successful. Have anyone have the experience or knowledge to share solution to get that data point from the SCTASK table? Or a solution? Your expertise and knowledge will be appreciated.  

Luis Roman (Lockheed Martin) - luis.a.roman@lmco.com

1 ACCEPTED SOLUTION

NikEng1
Giga Guru

That information is stored in special tables which you really can't report on.

If you want to be able to report on it, you can use metrics. Metrics are rows in a table, which you can report on. They capture things that happen to a record that would otherwise be overwritten or only saved in the sys_audit table.

Navigate to: Metrics > Definitions and create a "field value duration" metric for the assignment group field on the sc_task table. From that point onwards, each time a catalog task is assigned or reassigned to a different group, a row (metric instance) containing the group, task number and start and end date-time will be saved.

Below is an example for that same metric, but for the incident table. Notice the rows below the definition (stored in the metric_instance table). We can see that INC0010032 was assigned from the database group to the hardware group at 13:41:31 on the 18th of march.

You can join the sc_task table the metric_instance table in a database view. This will create a table where each sc_task is joined to all of its metric instances. In fact you might already have such a database view in your instance, with a table name of "sc_task_metric".

find_real_file.png

View solution in original post

3 REPLIES 3

NikEng1
Giga Guru

That information is stored in special tables which you really can't report on.

If you want to be able to report on it, you can use metrics. Metrics are rows in a table, which you can report on. They capture things that happen to a record that would otherwise be overwritten or only saved in the sys_audit table.

Navigate to: Metrics > Definitions and create a "field value duration" metric for the assignment group field on the sc_task table. From that point onwards, each time a catalog task is assigned or reassigned to a different group, a row (metric instance) containing the group, task number and start and end date-time will be saved.

Below is an example for that same metric, but for the incident table. Notice the rows below the definition (stored in the metric_instance table). We can see that INC0010032 was assigned from the database group to the hardware group at 13:41:31 on the 18th of march.

You can join the sc_task table the metric_instance table in a database view. This will create a table where each sc_task is joined to all of its metric instances. In fact you might already have such a database view in your instance, with a table name of "sc_task_metric".

find_real_file.png

NickEng - Thank you. I was able to defined the metric as you indicated. The issue that I have not is "how to" join the sc_task table the metric instance table in a database view. If you could refer me to the documentation on SC on how to perform that final step I will appreciated. 

Luis Roman - luis.a.roman@lmco.com 

There is usually a database view already included, which you can get to by typing sc_task_metric.list in the application navigator search bar.

 

If it does not exists, navigate to System Definition > Database Views and create one like this:

find_real_file.png

 

More information can be found here:

https://docs.servicenow.com/bundle/paris-platform-administration/page/use/reporting/concept/c_Databa...

 

Hope this helps, if so I would be grateful if you marked this as correct.