- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2023 06:04 AM
Work notes must be updated (with previous and current values) in RITM form if the catalogue variables have changed in RITM form.
Business Unit and Location both are catalogue variables and dropdown fields, PFA
Thanks in Advance!
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2023 06:22 AM - edited 07-14-2023 06:24 AM
Hello @Suresh36
You can use previous object in business rule script to get previous value and check with current value and add work notes based on the same.
Example script below:
Business Rule type is before update on RITM table
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var workNotes = "Below variable values are changed:\n";
var variablesUpdated = false;
if(current.variables.location != previous.variables.location){
workNotes += "\nLocation old value: " + previous.variables.location + "\t Location new value: " + current.variables.location;
variablesUpdated = true;
}
if(current.variables.business_unit != previous.variables.business_unit){
workNotes += "\nBusiness Unit old value: " + previous.variables.business_unit + "\t Business Unit new value: " + current.variables.business_unit;
variablesUpdated = true;
}
if(variablesUpdated){
current.work_notes = workNotes;
}
})(current, previous);
Note: Replace variable names as per your configuration in the script
Thank you,
Ali
Thank you,
Ali

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2023 06:22 AM - edited 07-14-2023 06:24 AM
Hello @Suresh36
You can use previous object in business rule script to get previous value and check with current value and add work notes based on the same.
Example script below:
Business Rule type is before update on RITM table
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var workNotes = "Below variable values are changed:\n";
var variablesUpdated = false;
if(current.variables.location != previous.variables.location){
workNotes += "\nLocation old value: " + previous.variables.location + "\t Location new value: " + current.variables.location;
variablesUpdated = true;
}
if(current.variables.business_unit != previous.variables.business_unit){
workNotes += "\nBusiness Unit old value: " + previous.variables.business_unit + "\t Business Unit new value: " + current.variables.business_unit;
variablesUpdated = true;
}
if(variablesUpdated){
current.work_notes = workNotes;
}
})(current, previous);
Note: Replace variable names as per your configuration in the script
Thank you,
Ali
Thank you,
Ali