Identify notifications as Internal/External

Matias7
Tera Expert

Hey everyone! I have a requirement to flag a notification as external/internal, and based on this, I use the advanced condition to verify this flag against the recipients, and allow/abort the action. I can't find a way of accessing the notification object from the advanced condition, as the "current" gives me the record which this notification is configured against (eg. incident). Any idea? If anyone did this in the past, I much appreciate some inputs (even a different approach for a similar result is more than welcome!)

2 ACCEPTED SOLUTIONS

Unfortunately there is no global variable defined for accessing the current notification record, the only js vars available (with a value) are

  1. current
  2. previous
  3. answer
  4. gs

View solution in original post

Rajesh_Bhise
Tera Guru

Hello @Matias7 ,

 

Have you tried gliderecord query for getting the current notification object ?

If not then you can use below simple code to get it.

 

***************************************************************************************

var sameNotif = new GlideRecord('sysevent_email_action');
sameNotif.addQuery('name', 'Sample Notification');
sameNotif.query();
if(sameNotif.next()){
    gs.info("Notification table is- "+sameNotif.collection);
    gs.info("Notification event name is- "+sameNotif.event_name);
}
****************************************************************************************
Note - You can create notification first and then you can use this script lines to get record.
 
I hope this would solve the problem. Please mark my answer as correct and helpful.
 
Thank You,
Rajesh

View solution in original post

6 REPLIES 6

Kieran Anson
Kilo Patron

Is this within a business rule on sys_email where you're wanting to identify the email notification that the current sys_email record relates too?

I want to put the condition in the "advanced condition" within the notification configuration. A similar example is the "Incident Resolved" notification (see attachment). But instead of using an incident information, I want to use information from the notification itself, and not send a notification for external accounts when it is classified as internal. Does that make sense?

 

Matias7_0-1716367623476.png

 

Unfortunately there is no global variable defined for accessing the current notification record, the only js vars available (with a value) are

  1. current
  2. previous
  3. answer
  4. gs

Thanks for your reply Kieran.