I need some assistance with a SQL query, I wonder what I'm doing wrong, or if I found a bug.
I am running the query below in my email alert actions to include the ServiceNow ticket numbers within the notification emails.
${SQL:SELECT IncidentUrl FROM [dbo].[SNI_AlertIncidents] WHERE AlertObjectId = ${N=Alerting;M=AlertObjectID} order by IncidentNumber DESC}
This query seems to work great with NPM node based alerts, and with SAM application based alerts, but when I try the same query with WPM based alerts I get the error seen below.
MACRO SQL ERROR - Object reference not set to an instance of an object.
I have verified that the ${N=Alerting;M=AlertObjectID} macro is working in the same WPM alert emails, so I'm not sure why the rest of the query doesn't work in WPM, but does for other alert types.
I figured I would ask the experts here before I opened a ticket for this issue.
Thanks in advance!
Dan