- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2018 12:17 PM
Hello community,
May i ask you how to extract all tickets handled by a user, because when i do a research with Keywords of the user's name, it shows me only tickets with a comment inserted, but a user :
- can add an attachment, without a comment
- reassign the ticket without adding comment.
So, the result of search doesn't reflect reality.
When a user insert a comment, add an attachment, or simply reassign it without comment, the name appears in the Activity. Why it is ignored on query ?
Thank you in advance.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2018 01:30 PM
Well there are 2 solutions to this:
1. If you only need a list of incidents handled by a user, just run the below in background script. You can replace "admin" by user id of your choice.
var audit = new GlideRecord('sys_audit');
audit.addQuery('user', 'admin');
audit.query();
while(audit.next()){
var gr = new GlideRecord('incident');
gr.addQuery('sys_id', audit.documentkey);
gr.query();
if(gr.next()){
gs.print(gr.number + " - " + gr.short_description);
}
}
2. Create a Database View connecting sys_audit and incident tables at Document Key = Sys ID and you can filter the user using user ID. Below is the screen shot.
And the result:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2018 01:00 PM
I would run a report on the sys_audit table. It should give you all of the information of what that tech touched.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2018 01:30 PM
Well there are 2 solutions to this:
1. If you only need a list of incidents handled by a user, just run the below in background script. You can replace "admin" by user id of your choice.
var audit = new GlideRecord('sys_audit');
audit.addQuery('user', 'admin');
audit.query();
while(audit.next()){
var gr = new GlideRecord('incident');
gr.addQuery('sys_id', audit.documentkey);
gr.query();
if(gr.next()){
gs.print(gr.number + " - " + gr.short_description);
}
}
2. Create a Database View connecting sys_audit and incident tables at Document Key = Sys ID and you can filter the user using user ID. Below is the screen shot.
And the result:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2018 01:48 PM
Thank you sirs.
Have a nice day.