This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Variable for ServiceNow Incident and Incident URL

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?