Report of IR's by Location
Best Answer
-
Shane_White Cireson Support Super IT Monkey ✭✭✭✭✭Hi @Scott_Wright
How is this one:SELECT ir.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C as 'Id', aml.DisplayName as 'LocationName',ir.Title_9691DD10_7211_C835_E3E7_6B38AF8B8104 as 'Title',lt.LTValue as 'Classification',lt2.LTValue as 'SupportGroup',lt3.LTValue as 'Status',FORMAT(ir.CreatedDate_6258638D_B885_AB3C_E316_D00782B8F688, 'dd/MM/yyyy') as 'CreatedDate'FROM [ServiceManager].[dbo].[MT_Cireson$AssetManagement$Location] as amlJOIN dbo.Relationship as rON r.TargetEntityId = aml.BaseManagedEntityId and r.RelationshipTypeId='D96C8B59-8554-6E77-0AA7-F51448868B43'JOIN dbo.BaseManagedEntity as bmeON r.SourceEntityId = bme.BaseManagedEntityIdJOIN dbo.MT_System$WorkItem$Incident as irON bme.DisplayName = ir.DisplayNameJOIN Dbo.LocalizedText as LTON ir.Classification_00B528BF_FB8F_2ED4_2434_5DF2966EA5FA = LT.MPElementIdAND Lt.LanguageCode='ENU'AND LT.LTStringType=1JOIN Dbo.LocalizedText as LT2ON ir.TierQueue_1E9615C2_3386_2452_BA83_05B2169DF38C = LT2.MPElementIdAND LT2.LanguageCode='ENU'AND LT2.LTStringType=1JOIN Dbo.LocalizedText as LT3ON ir.Status_785407A9_729D_3A74_A383_575DB0CD50ED = LT3.MPElementIdAND LT3.LanguageCode='ENU'AND LT3.LTStringType=1Where (ir.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C like 'IR%')
You could then do the same thing with SR/PR/CR and do a union to join all the tables but that would be quite long for me to post here haha! Just make sure the AS 'ColumnNames' all match up for the union to work.
Hope this helps
Shane5
Answers
Run this against your Service Manager Database and let me know if this is kind of along the lines on what you wanted?
Thanks,
Shane.
First, thank you for taking the time to share your solution. It's close, but I need to isolate the WI ID, so I can look up details from the SCSM DB (unless thay are also contained in the ServiceManager DB). I need to list:
WI, Location Name, Title, classification, support group, status, created date
Example:
Do you think this is possible?
How is this one:
You could then do the same thing with SR/PR/CR and do a union to join all the tables but that would be quite long for me to post here haha! Just make sure the AS 'ColumnNames' all match up for the union to work.
Hope this helps
Shane