- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2018 09:58 AM
I have a request where "My Request" widget needs to be modified to display requested item instead of request.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2018 12:53 PM
go to Service Portal -> Service Portal Configuration. then click on Portal Tables on the header menu then -> Menu Items.
search for My Requests. in the Server Script you can modify it to query the "sc_req_item" table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2018 12:53 PM
go to Service Portal -> Service Portal Configuration. then click on Portal Tables on the header menu then -> Menu Items.
search for My Requests. in the Server Script you can modify it to query the "sc_req_item" table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2018 01:00 PM
Yea, essentially you can just click on Service Portal > Menus and then select your header.
From there, there are two sections you'll need to edit:
1) Look for this line
t.record_watchers.push({'table':'incident','filter':'active=true' + u});
And add or remove (depending on if you want incidents to show as well)
t.record_watchers.push({'table':'sc_req_item','filter':'active=true' + u});
After that you'll see a group of script that looks like:
var st = new GlideRecord('sc_request');
if (st.isValid()) {
st.addActiveQuery();
st.addQuery('opened_by', gs.getUserID());
st.orderByDesc('sys_updated_on');
st.setLimit(max);
st.query();
while (st.next()) {
var a = {};
$sp.getRecordValues(a, st, 'short_description,sys_id,number,sys_updated_on');
if (st.short_description.nil())
a.short_description = "(No description)";
a.__table = st.getTableName();
a.type = 'record';
a.sortOrder = st.sys_updated_on.getGlideObject().getNumericValue();
t.items.push(a);
}
}
You'll want to copy, then paste it below that (or complete edit that section if you no longer want sc_request to show up), and edit it. Change the gliderecord to sc_req_item
This is all to say if sc_req_item is what you're wanting all along.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2018 01:06 PM
what is the difference between putting a filter for your table criteria in the t.record_watcher.push vs in the gliderecord script? for example whats the difference between 'filter':'active=true' and addActiveQuery()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2018 01:14 PM
The filter: active true part is an overall for what will push to the requests at the top of the SP. So like....it can show a number, for example 6 next to Requests right? Well that 6 comes from those push entries at the top and you are basically telling it you want them to be active incidents, requests, etc.
The addActiveQuery() is the script that leads to the next line. Basically telling the gliderecord....we're about to query you and this is what we're looking for...
Which leads to: st.addQuery('opened_by', gs.getUserID());
Telling it we want to know which of these are opened by me.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!