Trigger notification when state & latest comment/worknote contains "additional information required"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 07:16 AM
Hi Experts,
We have a requirement to trigger notification when state changed and latest comment/worknotes contains "additional information required".
Please help me with the solution.
Thanks, Jay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 07:32 AM
Hey Jay,
Navigate to Email > Notifications, create new, select table and if it will be triggered on insert or update and then click on advanced view, in the script section you can try the following
if (current.state.changes() && (
('' + current.comments).toLowerCase().indexOf('additional information required') > -1 ||
('' + current.work_notes).toLowerCase().indexOf('additional information required') > -1
)) {
answer = true; // send the notification
} else {
answer = false; // do nothing
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 08:09 AM
OOTB this way:
but to fulfil your requirement , you need to a script.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 09:43 AM
Create a Business Rule:
Navigate to System Definition > Business Rules.
Click New to create a new rule.
Set the table to the desired record type (e.g., Incident, Task).
Choose Before and Update as execution types.
Add Conditions:
Ensure the Business Rule runs when the state,work note and Additional comments field changes.
Use a condition like:
current.state.changes() && (current.comments.indexOf("additional information required") != -1 || current.work_notes.indexOf("additional information required") != -1)
- This checks if the state has changed and if the latest comments or work notes contain the specific phrase.
Trigger Notification:
Under Actions, create a new Email Notification.
Configure the recipient, subject, and message body to include relevant details.
Set the notification condition to trigger when the Business Rule runs by calling event from the business rule.
Alternate Approach: Scripted Action
If you need more control, create a Script Action inside the Business Rule:
if (current.state.changes()) {
var latestComment = current.comments || "";
var latestWorkNotes = current.work_notes || "";
if (latestComment.includes("additional information required") || latestWorkNotes.includes("additional information required")) {
gs.eventQueue("notify_additional_info", current, current.sys_id, current.sys_updated_by);
}
}
- Then, set up an Event (notify_additional_info) to trigger an email notification.
Stay awesome,
Roshnee Dash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 12:43 PM
Hi @Dhanunjay Kumar
If you found my response helpful, please mark it as correct and close the thread so others can benefit from it too.
Stay awesome,
Roshnee Dash