Redirect to RITM after clicking "Order Now" button in an article

Diego14
Kilo Explorer

Hi Everyone,

I’m using the London DEV personal instance and I’m trying to change the redirect page currently displayed after submitting a ticket.

If you navigate to the service catalog select “Packaging and Shipping”, Click “Order Now”, you arrive to the following page:

https://dev12345.service-now.com/sp?id=sc_request&is_new_order=true&table=sc_request&sys_id=4e6ca5e6...

That’s the page displaying the REQ number and the graphical stages of the RITM.

 

My requirement here is that after clicking on “Order Now”, I’d like to go to the RITM page where we can communicate directly in the ticket. The URL of the RITM is as follow:

https://dev12345.service-now.com/sp?id=ticket&table=sc_req_item&sys_id=ce6ca5e6db532300f1388a1848961...

 

I’ve cloned the Catalog Checkout widget and found the property in the Client Script where I can modify the behavior after clicking “Order Now”.

For instance, by replacing:

$location.search('id=sc_request&is_new_order=true&table=sc_request&sys_id=' + a.sys_id);

to

$location.search('id=services_status’);

 

I can see that the page is redirected to the services status.

If I copy paste the URL of the RITM above it works but this is static and I’d like this dynamic of course.

 

Would you have any idea about the appropriate property to use to have this working?

Thank you very much for your help J

4 REPLIES 4

Diego14
Kilo Explorer

Hello,

Is this requiring a lot of scripting or am I close enough with this configuration?

Thanks a lot for your support

The only tricky  part here is to get the RITM sys_id. Once you have that use the below url in location search

?id=ticket&table=sc_req_item&sys_id=523a9c730f072b40e1f30dbce1050eb4

Diego14
Kilo Explorer

Well that's exactly what I've been looking for but I do not know how to collect the ID and process it in the client script

 

Use the below snippet in client controller to get the RITM sys_id

where a.sys_id is the request sys_id

$http.get('/api/now/table/sc_req_item?sysparm_query=request=' + a.sys_id).then(function (response) {
				
					$window.alert('TEST: ' + response.data.result[0].sys_id);
				
			});