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

dvp
Mega Sage
Mega Sage

Please refer below bolg which explains how to show desired breadcrumbs

https://community.servicenow.com/community?id=community_blog&sys_id=0b8de669dbd0dbc01dcaf3231f9619f8

MS1
Kilo Expert

Thanks @dvp but, I guess this link is useful when we are traversing through the Catalog Items and its pages.

But I want to update the Breadcrumbs widget only for RITM and on the ticket page ID. So as to go back to its own request.

Home > Request> Ticket Form

Idea is same. You need to pass the correct values. I would try understand how it is funtioning for multi catalogs and leverage that for your requirement.

MS1
Kilo Expert

I am new to ServiceNow, can you help me with the code as to where to edit exactly in the OOB Breadcrumb widget to get that functionality?