Alternativ to sys_audit table for REST api

Benedikt Kaiser
Tera Contributor

Hi all,

 

I have currently a use-case where I need to retrieve the following information from a change-task:

- The exact time-stamp when the change-task was set to open 

- The exact time-stamp when the assignment group was changed

 

I know there is the sys_audit table. However, I cannot use this table due to reasons.

 

Is there any alternative where I can get the needed information?

 

Best regards,

Benedikt

1 ACCEPTED SOLUTION

Robbie
Kilo Patron
Kilo Patron

Hi @Benedikt Kaiser,

 

The 'Metric Definition' feature of ServiceNow allows you to track the timestamp of any record. Commonly known as 'Metrics', they can also be used (and are more commonly used) to track duration periods such as the time between certain states for example New to Assigned.

 

Find the link below where Armit has provided a tutorial if you're not familiar with Metrics.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

https://www.servicenow.com/community/developer-articles/servicenow-introduction-to-metric-instance-s...

View solution in original post

5 REPLIES 5

Robbie
Kilo Patron
Kilo Patron

Hi @Benedikt Kaiser,

 

The 'Metric Definition' feature of ServiceNow allows you to track the timestamp of any record. Commonly known as 'Metrics', they can also be used (and are more commonly used) to track duration periods such as the time between certain states for example New to Assigned.

 

Find the link below where Armit has provided a tutorial if you're not familiar with Metrics.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

https://www.servicenow.com/community/developer-articles/servicenow-introduction-to-metric-instance-s...

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Technically you can do this against sys_audit, though it should be a huge no no to do so. I think Robbie already made a nice suggestion using Metrics.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Sumanth16
Kilo Patron

Hi @Benedikt Kaiser ,

 

 1.Create a Metric definition on Change Task Table for the field to be tracked. In your case it would be - State

2. Create a Metric Instance, by selecting the Metric Definition you created above and make sure you update the Field value and value. In your case it would be 'Pending UAT'

3. Create a Report and select table as 'metric_instance' and in the filter option, select the Definition column and the Metric Definition you created. Then select the 'Start' and 'End' column to get time stamp in the report. 

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,
Sumanth Meda

 

Hi @Benedikt Kaiser,

 

How are you getting on? Did you see my response below?

 

The 'Metric Definition' feature of ServiceNow allows you to track the timestamp of any record. Commonly known as 'Metrics', they can also be used (and are more commonly used) to track duration periods such as the time between certain states, for example, New to Assigned.

 

Find the link below where Armit has provided a tutorial if you're not familiar with Metrics.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

https://www.servicenow.com/community/developer-articles/servicenow-introduction-to-metric-instance-s...