Notification Condition Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 08:52 AM
Hello ServiceNow Community,
I ran into an issue with having a notification send out based on certain conditions. We have a custom dropdown field in our group records named EA/IT services. This helps us divide our groups into two camps. Either IT services or EA. This carries over to the Incident table. When a technician leaves a comment in the Additional comments depending on which assignment group the technician resides a different notification will be sent. I have it working to an extent but would like to add a condition in the notification and need assistance in writing the script for this. Thank you all.
IT Service notification
EA Notification
Group Record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 10:25 AM
Currently, we have a read-only field named EA/IT Services in the incident record. The field auto-populates based on the assignment group EA/IT field designation. Which will trigger one of the notifications explained above. Which works 90% of the time. Sometimes the EA/IT services field is left null in the incident record. So if the technician leaves a update via the comments the caller will not get the notification because the condition for the EA/IT service field is null. I was able to correct this by a flow design but I want to see if I can have the notification skip the incident record EA/IT services field condition and send notification based on the assignment group EA/IT services designation.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 10:45 AM
@Wyatt Fudal1 I am assuming here in all scenario you will have "EA/IT services" value on Group record ? is that my correct assumption ?
You can apply dot walk filter in your notification.
doc link : Dot-walking examples
If you want to use script in your advanced notification condition then try with below samples.
if(current.assignment_group.u_ea_it_services.getDisplayValue() == "EA"){ // You can add many more condition based on your need.
answer = true;
} else {
answer = false;
};
Thanks,
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2024 09:11 AM
I apologize for the delay. The EA/IT services value is also on the group record. I'm very much a novice. Should I add a query to get the EA/IT service field value from the group record?