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

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

Thanks for your input Rajesh! This for sure is an option that at first I was trying to avoid as it was an "additional unnecessary" query at the time, but I think is the best option we have for this. Thanks!