- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Hi Team,
I am working on a notification requirement for Business Applications (cmdb_ci_business_app) where an email should be sent when the Operational Status changes, including both FROM and TO values.
Configuration details:
Table: cmdb_ci_business_app
Notification trigger:
Send when: Record Updated
Inserted: Unchecked
Condition: Operational status changes
Email content:
Previous Status: ${previous.operational_status}
Current Status: ${operational_status}
Observed behavior:
Notification triggers correctly on update
Current status value is populated
Previous status value is blank, even though the field value is clearly changing
preview
Expected behavior (example)
If a Business Application has:
Operational Status = Operational
And it is updated to:
Operational Status = Non-Operational
Then the notification email should contain:
Previous Status: Operational
Current Status: Non-Operational
please help me here how to fix this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
you can't use Previous object in notification body directly
Other way
-> after update BR on cmdb_ci_business_app, Condition: Operational status changes
Script:
(function executeRule(current, previous /*null when async*/) {
var oldStatus = previous.operational_status.getDisplayValue();
var newStatus = current.operational_status.getDisplayValue();
var param1 = "Previous Status: " + oldStatus + "<br/>" + "Current Status: " + newStatus;
// Trigger the event, passing the data
gs.eventQueue('your_event_name', current, param1, current.assigned_to); // Create 'your_event_name' in System Policy > Events
})(current, previous);
-> create event on that table and use that in BR script
-> also create notification on your table and make it trigger on your Event
-> Event parm2 contains recipient - True and this is the recipient to whom email will be sent
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
