How to get Incident_Metric data via SQL / ODBC?

srudenko
Kilo Explorer

We need to be able to pull in data which shows every single Assignment Group that has worked on an Incident
To do this we were directed to Reports section of Service Now and told to work with the 'Incident_Metric' view.

I was able to successfully setup a report to get the info we need on the web.
Here is what I have:

Type: List
Table: Incident Metric [incident_metric]
Group By: None
Selected Columns: Number(inc_number), Value
Filter: Definition IS Assignment Group

So this gets us what we need which is every ticket and the groups that it was assigned to from open to close.
This is good but we can't really do anything with this data on the web. We need to pull this into our SQL database.

Our SQL database is already linked with SN but I can't figure out how to setup an OPENQUERY to get the same information that we are getting through the web reporting. I also tried creating the query using MS Query and all I am getting are just blank results.

Can someone assist with this please?

10 REPLIES 10

david_legrand
Kilo Sage

That's weird and I don't use MS SQL Server...

So if we try to summary:
1) MS SQL Server queries "incident / problem / any table"
2) MS SQL Server doesn't query incident_metric

Could you try to query "metric_instance"? (metric instance is a table and incident_metric is a view)
Could you try to query "task_sla" (table) and "incident_sla" (view)?

Because i'm thinking that maybe you have an issue to query a view (it's weird but we're looking for a root cause).