How can I link directly to an incident if I know its number but not its sys_id?

jeffgehlbach
Kilo Explorer

Is there a way to create a UI link directly to an incident given only its number, lacking knowledge of its sys_id?

I'm developing an integration with Incidents. I have only a single field to work with on my side, because our ticketer interface was not designed to compensate for systems like ServiceNow that use one ID, e.g. INC0010003, to identify a ticket to humans but a different, machine-sensible sys_id for API operations.Storing only the sys_id is not an option because the ID stored on our side must be   human-sensible one for display purposes. For operations happening behind the scenes, my code can easily use the ReST API to look up the sys_id, but in our web UI I also need to create a direct hyperlink to an incident given the incident's number (e.g. INC0010003).

I've tried playing around with the /nav_to.do view, mashing up its query syntax with that of the /incident_list.do view by substituting a sysparm_query for the sys_id, but this approach appears not to be supported. If there's no way to do this, I'll have to implement a proxy web service that does the lookup behind the scenes and redirects the user, but I'd rather avoid this extra complexity if possible.

Any pointers on how to construct a web link directly to a SN Incident if I know only its number but not its sys_id?

Thanks in advance,

-jeff

1 ACCEPTED SOLUTION

dhasselquist
Mega Guru

I believe the following should work:



instance.service-now.com/nav_to.do?uri=incident.do?sysparm_query=number%3DINC0010003


View solution in original post

2 REPLIES 2

dhasselquist
Mega Guru

I believe the following should work:



instance.service-now.com/nav_to.do?uri=incident.do?sysparm_query=number%3DINC0010003


That does exactly what I needed.



Thanks, Dylan!


-jeff