- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 09:08 PM
Hi,
Here i have to get the previous assigned to member's name who reassigned his ticket to another i.e current assigned to member.
How can i get it?
Dear Insert First Name of Assigned To, Insert Full Name of the person who re-assigned the ticket has re-assigned this support ticket to you for resolution. Please find a summary below of the ticket you will need to action. Thank You. |
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2018 02:09 AM
Hi Sheetal,
Here is your Final Code:
var gr = new GlideRecord('incident');
gr.addQuery('active', true);
//gr.addQuery('sys_id','2b15abf6db230300e77dd450cf961925'); // Just for testing one incident
gr.query();
if (gr.next()) {
var watch = current.watch_list;
var spl = watch.split(',');
gs.log(spl); // the code is working till this line
for (var i = 0; i < spl.length; i++) {
var list = spl[i];
gs.log('List '+list);
var usr = new GlideRecord('sys_user');
usr.addQuery('sys_id',list);
usr.query();
if(usr.next())
{
gs.log('First Name '+usr.first_name);
gs.eventQueue('WatchlistAlert',current,usr.first_name,current.watch_list);
}
}
}
Thank you,
Ashutosh Munot
Please Hit Correct, Helpful or like,if you are satisfied with this response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 03:29 AM
HI,
Try only one group by:
See below code:
var gaDupCheck1 = new GlideAggregate('incident');
gaDupCheck1.addQuery('active','true');
gaDupCheck1.addAggregate('COUNT','category');
gaDupCheck1.groupBy('category');
gaDupCheck1.addHaving('COUNT','>',3);
gaDupCheck1.query();
while(gaDupCheck1.next()) {
gs.log('Here '+gaDupCheck1.category);
}
Thanks,