Service Portal show closed incidents and request items

steveturley2
Giga Expert

Hi all

We've got a requirement for the ServicePortal to show users closed as well as their open incidents & requests.

The list of these comes from a Header Menu scripted list called 'My Calls'

Looking at the code, is it as simple as removing the highlighted text, or something a bit cleverer?

find_real_file.png

1 ACCEPTED SOLUTION

Dont remove

t.record_watchers.push({'table':'incident','filter':'active=true^caller_id=' + u});
t.record_watchers.push({'table':'sc_request','filter':'active=true^requested_for=' + u});

replace them with 

t.record_watchers.push({'table':'incident','filter':'caller_id=' + u});
t.record_watchers.push({'table':'sc_request','filter':'requested_for=' + u});

and in places where you have used addActiveQuery(), add an "//" before them 

View solution in original post

16 REPLIES 16

Yeah, I missed the the max setting at the top. 5 entries is correct.

But then again I think that would mean that if there aren't any opened items, the last 5 closed items will always appear in the list. 

That could possibly be OK though. 

 

So basically I'm removing the entire lines below? (Adding '//' to each line removes their functionality, yes?)

t.record_watchers.push({'table':'incident','filter':'active=true^caller_id=' + u});
t.record_watchers.push({'table':'sc_request','filter':'active=true^requested_for=' + u});

And do likewise to the "addActiveQuery() after  'var z = new GlideRecord('incident')' and 'var z = new GlideRecord('sc_request')'?

 

Apologies for the step-by-step questions. Cheers!

Dont remove

t.record_watchers.push({'table':'incident','filter':'active=true^caller_id=' + u});
t.record_watchers.push({'table':'sc_request','filter':'active=true^requested_for=' + u});

replace them with 

t.record_watchers.push({'table':'incident','filter':'caller_id=' + u});
t.record_watchers.push({'table':'sc_request','filter':'requested_for=' + u});

and in places where you have used addActiveQuery(), add an "//" before them 

Aha! I think that's it. Thanks everyone!

 

(I now have an issue where I can't tell which calls are open and which aren't, but I suspect that might be for another thread)