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.

How to edit Breadcrumbs Widget on Service Portal so as to get Home>Request>Ticket Form ?

MS1
Kilo Expert

In the ticket page of RITM on Portal, there is no way to get back to the parent Request. 

How should I edit the Breadcrumbs Widget so as to get  'Request' breadcrumb in between Home and Ticket Form on the page id- ticket to get back to RITM's  parent Request only for RITM tickets on Service Portal.

@Robert Fedoruk @Göran Lundqvist @Michael Ritchie  @Ankur Bawiskar @Anurag Tripathi @Ali @Shishir Srivastava @Harshvardhan ..Please help me as i have to deliver this work on priority.

find_real_file.png

1 ACCEPTED SOLUTION

Please clone Ticket Fields widget and update the following snippets of code

 

Server Script

Add the below server code after the lines

data.table = input.table || $sp.getParameter("table");
data.sys_id = input.sys_id || $sp.getParameter("sys_id");

if(data.table == 'sc_req_item'){
		data.request = {
			name: 'Request',
			url: '?id=sc_request&table=sc_request&sys_id='+gr.request.toString()
		}
	}

Client controller

	var bc = [];
		if ($scope.data.request)
			bc[bc.length] = {label: $scope.data.request.name, url: $scope.data.request.url};
		bc[bc.length] = {label:'Ticket Form', url: '#'};
		$rootScope.$broadcast('sp.update.breadcrumbs', bc);
		spUtil.setSearchPage('sc');

 

Also update the widget field widget instance with cloned widget

 

find_real_file.png

View solution in original post

7 REPLIES 7

Please clone Ticket Fields widget and update the following snippets of code

 

Server Script

Add the below server code after the lines

data.table = input.table || $sp.getParameter("table");
data.sys_id = input.sys_id || $sp.getParameter("sys_id");

if(data.table == 'sc_req_item'){
		data.request = {
			name: 'Request',
			url: '?id=sc_request&table=sc_request&sys_id='+gr.request.toString()
		}
	}

Client controller

	var bc = [];
		if ($scope.data.request)
			bc[bc.length] = {label: $scope.data.request.name, url: $scope.data.request.url};
		bc[bc.length] = {label:'Ticket Form', url: '#'};
		$rootScope.$broadcast('sp.update.breadcrumbs', bc);
		spUtil.setSearchPage('sc');

 

Also update the widget field widget instance with cloned widget

 

find_real_file.png

MS1
Kilo Expert

Thank you so much. It works perfectly! @dvp

Anusha Bhashyam
Kilo Explorer

I have followed this, but did not work. My requirement is same as this. Could you please share the reference how you have done this?