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

Hi, ok. Yea that was the exact same link I posted above.

Glad you got it working.

Please mark any other reply as Helpful, if it was. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Community Alums
Not applicable

Hi TJ,

 

Thank you for posting the solution. Redirect works fine however, when we try to add comments, system loads conversation from different RITM which it automatically creates. Did you face any such problem?

Hi, did you figure this out? I have the problem where the comments are not getting added to the RITM.

Yuri de Souza V
Giga Contributor

To solve the problem when you a try to add comments, system loads conversation from different RITM which it automatically create.

Just change the "gr.sys_id;" to "gr.getUniqueValue();"

 

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.sys_id = gr.getUniqueValue();
			data.table = 'sc_req_item';
		}
	}

Community Alums
Not applicable

Hi, 

 

done changes as above clone ticket field widget ,updated and added on page also .

Created Page route map also. But nothing is showing for me . 😞 

find_real_file.png

find_real_file.png

updated ticket conversation widget also.

What is missing from my end.