How to get state suration values for all existing RITMS and SCTASK ?

Servicenow lear
Tera Contributor

We are trying to pull state duration information for RITM and SCTASK such as 

how long ticket remained in open state >>pending approval >> approved stage >>closed.

 

We explored metric definition but it only does for new request not for old. How can we fulill above use case ? 

1 ACCEPTED SOLUTION

Swapna Abburi
Mega Sage
Mega Sage

Hi @Servicenow lear 

I do not think you can get state durations for old RITMs and SC tasks easily without metric definitions. 

 

if it is a must, you can try HistoryWalker API to fetch historical data of a record using audit/history table and generate metric instances manually using script, but please note, using these APIs and querying audit tables in custom scripts is NOT recommended considering the performance issues.

View solution in original post

4 REPLIES 4

Swapna Abburi
Mega Sage
Mega Sage

Hi @Servicenow lear 

I do not think you can get state durations for old RITMs and SC tasks easily without metric definitions. 

 

if it is a must, you can try HistoryWalker API to fetch historical data of a record using audit/history table and generate metric instances manually using script, but please note, using these APIs and querying audit tables in custom scripts is NOT recommended considering the performance issues.

Ankur Bawiskar
Tera Patron
Tera Patron

@Servicenow lear 

that's correct, it won't work for older records.

check this

HistoryWalker - Scoped, Global 

History Walker Examples

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Servicenow lear 

As per new community feature you can mark multiple responses correct.

If my response helped please mark it correct as well so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Servicenow lear 

any update to this?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader