- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2014 05:39 AM
We want a notification to be send only when the ticket is updated by someone else then the person/s on work notes list.
Is this possible to script with an advanced condition?
What I've been trying without success is the following two examples
if (current.work_notes_list != current.sys_updated_by){
answer = true;
}
OR
if (current.work_notes_list.user_name != current.sys_updated_by){
answer = true;
}
I always get it to return true even if it's updated by the person who is in the "work notes list" field.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2014 08:05 AM
i hate it when at times you get a sys_id, and then when you want it, you have to dig to get it.
var gr = new GlideRecord('sys_user');
gr.query('user_name',current.sys_updated_by);
gr.query();
if (gr.next())
{
uid = gr.sys_id;
if(current.work_notes_list.toString().indexOf(uid) != -1)
answer = true;
else
answer = false;
}
else
answer = false;
If the user cannot be found in the sys_user table, it will not send - change line 13 to switch that
If it finds a matching user, it then looks and if the user Id is in the work_notes_list, it will send otherwise it will not
you can switch it by adding an ! at line 7, or swapping lines 8 and 10 around
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2014 08:06 AM
I tend not to declare the answer variable. Seen is cause a problem before

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2014 08:13 AM
change the variable name thats just a flag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2014 07:26 AM
It's triggered on insert/update to a ticket
Condition is work notes changes.
Problem we have is when the ticket send a mail to users on the work notes list and they reply to it, the reply will be posted as a work note, and they'll get a new mail notification containing info from the work note list (which is the actual mail they send in).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2014 12:11 PM
If I understand the issue properly, I think your solution should be as simple as ensuring the "Send to event creator" checkbox is NOT checked on the Notification record (you may have to switch to the Advanced view to see it).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2014 11:41 PM
That should work as well I assume. Will have to test it later on.