Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Direct link URL to incident or request item

zed
Kilo Contributor

I know how to create direct links to an incident or a request item using the URL navigation format:

https://xxx.service-now.com/nav_to.do?uri=incident.do?sysparm_query=number=INCXXXX for incidents

https://xxx.service-now.com/nav_to.do?uri=sc_req_item.do?sysparm_query=number=RITMXXXX for request items

 

However, is there a way to use a single URL that will take you to the incident or request item based on the number?

 

The scenario is this: I have an application that allows you to link a field value to a URL template so you can link directly into another app (in this case Service-Now). The problem I'm running into is that the ID could either be an incident or a request item. Since the URL has to be predefined I cannot change it based on the ID type. I need a URL within service now that will take either an incident or request item number and open the right item.

 

Hopefully that makes sense.

 

Thanks.

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

Hi Zack,



Incident and RITM both roll up to Task table, So make ur generic url like this



https://xxx.service-now.com/task.do?sys_id=<Sys id of your RITM or Incident>



If you dont have the sys_id then



https://xxx.service-now.com/nav_to.do?uri=task.do?sysparm_query=number=



Hope this helps


-Anurag

View solution in original post

12 REPLIES 12

jfreeman_10
Kilo Contributor

The above solution works; however, it did not display all of the fields for change request items I needed to see. Here are some examples that worked for me:

https://xxx.service-now.com/nav_to.do?uri=change_request.do?sysparm_query=number=<CHG number>


https://xxx.service-now.com/nav_to.do?uri=incident.do?sysparm_query=number=<INC number>

 

Good luck!

Michel Samia
Kilo Contributor

The above examples didn't work for me on one instance (and worked on another one). To make it work on all instances, I had to URL encode the '?' (questionmark) - replace it by "%3F"

so the final url is https://xxx.service-now.com/nav_to.do?uri={table_name}.do%3Fsysparm_query=number={ABC0001234}

You can replace {table_name} by any table so you can search any record this way which has at least one column unique. Column called Number, which is recommended and widely used, is a great candidate to use 🙂

Rakeshlal KJ1
Tera Contributor

This really helps !!!