How can I filter search results to only show Requests and Incidents from Service Portal View All link? We have the following from out of the box Service Portal (Helsinki): var link = {title: gs.getMessage('View all requests'), type: 'link', href: '?

Kamran1
Kilo Guru

How can I filter search results to only show Requests and Incidents from Service Portal View All link? We have the following from out of the box Service Portal (Helsinki):  

var link = {title: gs.getMessage('View all requests'), type: 'link', href: '?id=list&table=task&filter=active%3Dtrue%5Eopened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe%5EEQ', items: []};e

View all requests in the above points to task table which shows anything in the task table such as requested items, tasks, incidents and requests. I would appreciate if anyone could point out how to further filter results to only show Requests and Incidents submitted by the end user and filter out the rest. I am fairly new to Service Portal and no scripting background.

Thanks,

Kamran

1 ACCEPTED SOLUTION

marcguy
ServiceNow Employee
ServiceNow Employee

Arh I see the issue, it's bascially saying at the moment table is task OR sys_class_name is... and it should be



table is task AND sys_class name is....


active%3Dtrue%5Esys_class_name%3Dincident%5EORsys_class_name%3Dsc_request



so full url would be


var link = {title: gs.getMessage('View all requests'), type: 'link', href: '?id=list&table=task&filter=active%3Dtrue%5Esys_class_name%3Dincident%5EORsys_class_name%3Dsc_request%5Eopened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe%5EEQ', items: []};


View solution in original post

5 REPLIES 5

marcguy
ServiceNow Employee
ServiceNow Employee

would probably need to see the widget code to see if we can hide that element, what you may be able to do in the client script part of the widget is find out the ID of the filter elements, using developer tool and right-click 'Inspect Element' on the filter breadcrumb and then use a call in the client to hide it.