The Zurich release has arrived! Interested in new features and functionalities? Click here for more

"Duration" column on 'sc_task' table?

tajarichardson
Mega Expert

Hello community, 

Quick question about the "Duration" column on the sc_task table. Is this column naively not used? I was hoping to do some simple reports round it instead of having to build PA, but the column is blank when I look at it on the table. 

I've made PA to calculate time from open to close for the sc_task table before, but wanted some "snapshot" data. 

3 REPLIES 3

Harsh Vardhan
Giga Patron

OOTB it's not any Business rule or other server side script has been written to update this field value.

but you can use it according to your requirement

as you had mentioned you want to check the duration on task from open to close then you can write a business rule to update the duration value.

adding one thread here which will help you to populate the duration value .

https://community.servicenow.com/community?id=community_question&sys_id=660164bfdb7fd340a39a0b55ca96...

Awesome, thank you for your help!

Josh Cooper
ServiceNow Employee
ServiceNow Employee

That might be a column that's inherited from the task table that it extends.  In a pinch, if you look at the business rules on Incident, you should be able to find the one that sets the value when the incident is resolved.  I think it's helpfully called something like "Calculate Duration on Resolve"

SC_Tasks don't have a 'resolve' state, but you can copy that business rule, set it up on the sc_task table, give it better trigger conditions  (closed vs resolved) and use it to populate that value for you so you can report on it.

There are similar metric definitions in the Metrics area that are set up around measuring resolve times for Incidents as well, so you may also be able to use that, if needed, to get more information (as well as any other metrics that may be interesting for sc_tasks).  The business rule that causes metrics to run on records is against the core task table, I believe, so all you would need to do is create a new Metric Definition and those metrics will be calculated for every sc_task going forward.