How do you do a redirect to a RITM on submitting a request from the Service Portal?

TJ Sandor
Kilo Expert

I've been trying to get a re-direct on catalog item submit to work in our current London environment. We want the next page after submit to be the RITM; NOT the Request. We are a 1:1 environment here. 

I've tried several approaches, including one that had PREVIOUSLY worked for us when the portal was first built back in Jakarta. It will not work with the current iteration of "SC Catalog Item" widget. 

Does anyone know what I must configure on the widget to make it redirect to the RITM, not the REQ?

Thanks for reading!

TJ

1 ACCEPTED SOLUTION

Thank you Allen! I did end up finding this one online too!

It was SOOO helpful. 

I ended up using: https://community.servicenow.com/community?id=community_question&sys_id=53a64765db1cdbc01dcaf3231f96...

I edited two widgets for "Ticket Form" page. "Ticket Fields" and "Ticket Conversations" were cloned and edited. 

In "Ticket Conversations" widget (server script):

if (data.table == 'sc_request'){
		var item = new GlideRecord('sc_req_item');
		item.addQuery('request',data.sys_id);
		item.query();
		if (item.next()) {
			gr = item;
			data.sys_id = gr.sys_id;
			data.table = 'sc_req_item';
		}
	} 

 

In "Ticket Fields" widget (server script):

var gr = $sp.getRecord();
	var sys_id = $sp.getParameter("sys_id");
  var table = $sp.getParameter("table");
  if (table == 'sc_request') {
	   var item = new GlideRecord('sc_req_item');
	   item.addQuery('request',sys_id);
	   item.query();
	   if (item.next()) {
		    gr = item;
	   }
  }

Finally, I created a "Page Route Map" to redirect "SC Request" to "Ticket Form".

 

 

View solution in original post

13 REPLIES 13

Manisha, did you ever get this figured out?

Thank you Yuri de Souza Vidal! This worked for me

 

Johannes Mweli
Giga Guru

Hi Community Developers,

I am using the above solution to redirect to the RITM conversations form when creating a ticket and it is working fine for me. There is however an issue that I am running into. The issue is that even though the redirect works the url however is still pointing to the sc_request table instead of the sc_req_item table. This causes the business rules that run on the sc_req_item to not fire when you update the RITM from the service portal. For instance after submitting the RITM I land on this url:

https://eagledev.service-now.com/sp?id=sc_request&is_new_order=true&table=sc_request&sys_id=7cc2f90a1b38f018e8ff0fe7cc4bcb17

When I make updates on the RITM the business rules running on sc_req_item don't fire because the system is recognizing these updates as coming from sc_request. 

However if I navigate back to the home page and reopen the RITM in just created I land on the url:

https://eagledev.service-now.com/sp?sys_id=b0c2f90a1b38f018e8ff0fe7cc4bcb18&view=sp&id=ticket&table=sc_req_item

The url above points to the RITM that I created and successfully redirected to using the above solution. When I make updates on the RITM from this url the business rules on sc_req_item table are firing as expected. 

Do you guys know how can I dynamically switch the urls as well and redirect to the second url on ticket creation? 

Kindly advise please

Thanks,

Johannes

yaswanth
Tera Contributor

Hi TJ,

I have a similar requirement like this, but so i did changes in page route map it will redirect to RITM page now, it is working only for catalog items, when we raise a order guide or add multiple items it will show only one RITM'S instead of multiple RITM's. 

Do you achieve that one also. kindly give the reply.

 

 

Thanks and Regards

yaswanth