Open Incidents - SCSM

Does anyone know what query Matt used for the count of the incidents in the ServiceManager Integration videocast? The QuickStart has the field but I am having difficulties finding a query to populate that field.

Cheers!

1 Like

Have you taken the scripts from here?

https://github.com/squaredup/Scripts/tree/master/integration-examples/System%20Center%20Service%20Manager/T-SQL%20Queries

Dont now if the count query is there but you should be able to modify one of them to do a count instead.

https://docs.microsoft.com/en-us/sql/t-sql/functions/count-transact-sql

2 Likes
-- Select all incidents
SELECT 
	COUNT(*) as Total
FROM IncidentDimvw as incident
Where CreatedDate > DATEADD(d, -120,  GETUTCDATE())

That’ll get all incidents in the SCSM Datawarehouse that are less than 120 days old. If you need to do this for a perspective (computer, app, DB etc) just attach more where clauses to limit the query down to incidents related to your particular object (if you have the SCOM <-> SCSM CI connector enabled, they’ll share the same MonitoringObjectId, which makes it pretty easy).

2 Likes

Thanks Vyper!! That worked like a champ!