Query or power shell command to find out all the analyst comments logged for an incident
I am trying to find out all the analyst comments logged for an particular incident, I tried querying the cmdb table  MT_System$WorkItem$TroubleTicket$AnalystCommentLog but it requires Basemanagedentity id, in order to search bmeid I queried incident table but no luck the bmeid from incident table does not return any output in analystcommentlog, any help would be greatly appreciated. 
August 20th, 2015 3:23am

You want/need to query the SQL database? Or does a PowerShell Script works for you as well?

Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 3:41am

The SQL for that is:

select cLog.DisplayName, 
	cLog.Comment_AECE7B96_331B_498C_2F77_AEA4376EFFF1, 
	cLog.EnteredBy_A14C9A28_2F82_D1F2_BCCD_A4E3745179B5
from dbo.MT_System$WorkItem$Incident as ir
inner join dbo.Relationship as rel
on ir.BaseManagedEntityId = rel.SourceEntityId
inner join dbo.MT_System$WorkItem$TroubleTicket$AnalystCommentLog as cLog
on rel.TargetEntityId = cLog.BaseManagedEntityId
where ir.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C = 'IR#'

August 20th, 2015 9:43am

The SQL for that is:

select cLog.DisplayName, 
	cLog.Comment_AECE7B96_331B_498C_2F77_AEA4376EFFF1, 
	cLog.EnteredBy_A14C9A28_2F82_D1F2_BCCD_A4E3745179B5
from dbo.MT_System$WorkItem$Incident as ir
inner join dbo.Relationship as rel
on ir.BaseManagedEntityId = rel.SourceEntityId
inner join dbo.MT_System$WorkItem$TroubleTicket$AnalystCommentLog as cLog
on rel.TargetEntityId = cLog.BaseManagedEntityId
where ir.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C = 'IR#'

Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 1:42pm

The SQL for that is:

select cLog.DisplayName, 
	cLog.Comment_AECE7B96_331B_498C_2F77_AEA4376EFFF1, 
	cLog.EnteredBy_A14C9A28_2F82_D1F2_BCCD_A4E3745179B5
from dbo.MT_System$WorkItem$Incident as ir
inner join dbo.Relationship as rel
on ir.BaseManagedEntityId = rel.SourceEntityId
inner join dbo.MT_System$WorkItem$TroubleTicket$AnalystCommentLog as cLog
on rel.TargetEntityId = cLog.BaseManagedEntityId
where ir.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C = 'IR#'

  • Marked as answer by Nikhil Lotia Sunday, August 23, 2015 5:48 AM
August 20th, 2015 1:42pm

The SQL for that is:

select cLog.DisplayName, 
	cLog.Comment_AECE7B96_331B_498C_2F77_AEA4376EFFF1, 
	cLog.EnteredBy_A14C9A28_2F82_D1F2_BCCD_A4E3745179B5
from dbo.MT_System$WorkItem$Incident as ir
inner join dbo.Relationship as rel
on ir.BaseManagedEntityId = rel.SourceEntityId
inner join dbo.MT_System$WorkItem$TroubleTicket$AnalystCommentLog as cLog
on rel.TargetEntityId = cLog.BaseManagedEntityId
where ir.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C = 'IR#'

  • Marked as answer by Nikhil Lotia Sunday, August 23, 2015 5:48 AM
Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 1:42pm

The SQL for that is:

select cLog.DisplayName, 
	cLog.Comment_AECE7B96_331B_498C_2F77_AEA4376EFFF1, 
	cLog.EnteredBy_A14C9A28_2F82_D1F2_BCCD_A4E3745179B5
from dbo.MT_System$WorkItem$Incident as ir
inner join dbo.Relationship as rel
on ir.BaseManagedEntityId = rel.SourceEntityId
inner join dbo.MT_System$WorkItem$TroubleTicket$AnalystCommentLog as cLog
on rel.TargetEntityId = cLog.BaseManagedEntityId
where ir.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C = 'IR#'

  • Marked as answer by Nikhil Lotia Sunday, August 23, 2015 5:48 AM
August 20th, 2015 1:42pm

Thank you so much Andreas for your time and help.
Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2015 1:53am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics