Service Portal - Viewing team tickets

davidreid
Kilo Contributor

In our Service Portal that was developed by a third party, we have a section along the top of the screen with personalised options for the logged in user

find_real_file.png

Clicking on the User name brings up the user record and they can get to the Knowledge base and Service Catalog from this section too. Also, as you can see above, there is a drop down where the user can view their open tickets. What I'd like to do is change this so that the user can also view tickets raised by their team colleagues as well as themselves (each user record has a populated team field - u_team in the sys_user table) - how can I do this?

1 ACCEPTED SOLUTION

antin_s
ServiceNow Employee
ServiceNow Employee

Hi David,



You need to modify 'My Requests' widget's Server script   - http://instancename.service-now.com/sp_config?id=widget_editor&sys_id=f1672671d7301200a9addd173e24d4... as follows.



1. Created a new function to get current user' team.



function getMyTeam(userID){


gs.log(userID);


var user = new GlideRecord('sys_user');


if(user.get(userID))


return user.team;


}



2. Replace the line 'gr.addEncodedQuery('requested_for=javascript:gs.getUserID()');' with the below lines



var myTeam = getMyTeam(gs.getUserID());


gr.addQuery('team', myTeam);




3. Change the line 'var gr = new GlideRecordSecure('sc_request');' to use GlideRecord as below



var gr = new GlideRecord('sc_request');




With all the changes, it would look like this.



find_real_file.png



Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


View solution in original post

8 REPLIES 8

Hi - I can't find where I mark something as Correct? How do I do this?



(Apologies - I'm new here!)


antin_s
ServiceNow Employee
ServiceNow Employee

Hi David,



Please try this URL - Re: Service Portal - Viewing team tickets



If you still cant find the 'Correct Answer' button, please refer the below post.



How To Mark Answers Correct From Community Inbox



Thanks


Antin


Got it, thanks


chirag_bagdai
ServiceNow Employee
ServiceNow Employee

Hi David,



That's a menu option which you need to modify. Please find below steps :



1. Select "Menus" which is under Service Portal & select "SP Header Menu"


Screen Shot 2017-07-24 at 3.02.22 AM.png


2. Open "Request" Menu item :


Screen Shot 2017-07-24 at 3.03.22 AM.png


3. Modify the filter conditions (include script which can prepare list of team member and provide that list in filter condition)