I am currently using this custom SQL variable to grab the ServiceNow Incident Number and URL:
Incident Number: ${SQL:SELECT IncidentNumber FROM [dbo].[SNI_AlertIncidents] WHERE AlertObjectID = ${N=Alerting;M=AlertObjectID} ORDER BY IncidentNumber DESC}
URL: ${SQL:SELECT IncidentUrl FROM [dbo].[SNI_AlertIncidents] WHERE AlertObjectID = ${N=Alerting;M=AlertObjectID} ORDER BY IncidentNumber DESC}
The problem is, this only works sometimes. I believe there is some sort of delay in the ServiceNow integration so it can't grab the ticket number or url. Does anybody have a better solution for putting the ServiceNow Incident in URL in an alert?