- 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
‎01-12-2018 10:54 PM
Hi Sheetal,
Yes, it is to trigger an event based notification.
In your notification, you can use email scripts to access the event parameters which you can use in your email template.
Mail script has access to event parameters, you can access both the event parameters and construct your notification accordingly.
Scripting for email notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2018 12:52 AM
hmm thanks got your point
one more i have a code , can you please check and tell me where is the error?
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('incident');
gs.addInfoMessage('hi');
gr.addQuery('active', true);
gs.addInfoMessage('1');
gr.query();
if (gr.next()) {
gs.addInfoMessage('2');
var watch = current.watch_list;
gs.addInfoMessage('A'); // the code is working till this line
for (var i = 0; i < watch.length; i++) {
gs.addInfoMessage('3');
var list = watch[i];
gs.eventQueue('Watchlist Alert',current,list.first_name.getDisplayValue(),current.watch_list);
gs.addInfoMessage('3');
}
}
})(current, previous);

- 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
‎01-13-2018 02:40 AM
thank you so much its working but how to print parm1 in email template?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2018 02:45 AM
HI Sheetal,
Use ${event.parm1}
It will be good if you mark it as correct.
Thank you,
Ashutosh Munot