diff --git a/Server-Side Components/Business Rules/README.md b/Server-Side Components/Business Rules/README.md new file mode 100644 index 0000000000..f7e542d4b4 --- /dev/null +++ b/Server-Side Components/Business Rules/README.md @@ -0,0 +1,34 @@ +About this script : + +Type: Before Business Rule +Table: Reminder [reminder] +When: Before Insert or Update + +This Business Rule automatically generate a reminder message for Tasks that are approaching their closure time. +It dynamically fills in the Subject, Notes, and Using fields with a formatted message, ensuring consistent and timely communication. + +What it does : +It retrieves the Task number from the task field. +It reads the reminder time (remind_me) to know how many minutes before closure the reminder should be sent. +It builds a subject line like: + +“Change Request CHG001234 Closure Approaching in 30 Minutes” + +It builds a message body explaining the reminder details. +It automatically sets: +subject → reminder subject line +notes → reminder message body +using → "outlook" (indicating reminder channel) + +Use of this script : +This automation ensures that Change Managers and implementers are reminded before a Change Request closes, reducing the risk of: +Missing required closure tasks +Incomplete validations or documentation +Unnotified team members before system changes finalize + + +Please find the screenshots attached for clarity. +image +image + + diff --git a/Server-Side Components/Business Rules/change_close_reminder.js b/Server-Side Components/Business Rules/change_close_reminder.js new file mode 100644 index 0000000000..b3f1a03a64 --- /dev/null +++ b/Server-Side Components/Business Rules/change_close_reminder.js @@ -0,0 +1,15 @@ +(function executeRule(current, previous /*null when async*/) { + + var tsk_number = current.getDisplayValue('task'); // Get Change Request number + var time = current.getValue('remind_me'); // Reminder time in minutes + + var subject = 'Change Request ' + tsk_number + ' Closure Approaching in ' + time + ' Minutes'; + var body = 'This is a reminder that Change Request ' + tsk_number + + ' is scheduled to close in ' + time + ' minutes. Please ensure that all necessary ' + + 'tasks, validations, and documentation are completed before the closure.'; + + current.setValue('subject', subject); + current.setValue('notes', body); + current.setValue('using', 'outlook'); + +})(current, previous);