- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-19-2026 03:56 AM
i want to update the change request "close notes" field with given cancel reason by the user through on cancel change UI Action button.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-19-2026 06:39 AM
Hi @srushikesan,
I was able to achieve the requirement without modifying the OOTB Cancel Change UI Action.
Since the cancellation reason entered in the Cancel Change Request dialog is already stored in Work Notes, I created a Before Update Business Rule on the Change Request [change_request] table that triggers when the Change moves to the Canceled state and copies the latest Work Note into Close Notes.
(function executeRule(current, previous) {
if (current.state.changesTo('4')) {
var reason = current.work_notes.getJournalEntry(1);
if (reason) {
current.close_notes = reason;
}
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-19-2026 07:14 AM
Hi @srushikesan ,
You can use this
(function executeRule(current, previous) {
if (current.state.changesTo('4')) {
var reason = current.work_notes.getJournalEntry(1);
if (reason) {
// Remove timestamp, user name and "(Work notes)" header
reason = reason.replace(/^[^\n]*\n/, '').trim();
current.close_notes = reason;
}
}
})(current, previous);This will store only:Server reboot no longer required
instead of:2026-06-19 19:22:26 - System Administrator (Work notes) Server reboot no longer required
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-19-2026 06:39 AM
Hi @srushikesan,
I was able to achieve the requirement without modifying the OOTB Cancel Change UI Action.
Since the cancellation reason entered in the Cancel Change Request dialog is already stored in Work Notes, I created a Before Update Business Rule on the Change Request [change_request] table that triggers when the Change moves to the Canceled state and copies the latest Work Note into Close Notes.
(function executeRule(current, previous) {
if (current.state.changesTo('4')) {
var reason = current.work_notes.getJournalEntry(1);
if (reason) {
current.close_notes = reason;
}
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-19-2026 06:56 AM
Hi Pawan Rathod,
Thanks for your response and it is working as expected but i don't want to show the "026-06-19 19:22:26 - user name (Work notes)" in close notes only the reason text.
Thanks
S Rushikesan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-19-2026 07:02 AM
Thanks Pawan Rathod can you suggest to remove the "2026-06-19 19:20:25 - user name (Work notes)" in close notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-19-2026 07:14 AM
Hi @srushikesan ,
You can use this
(function executeRule(current, previous) {
if (current.state.changesTo('4')) {
var reason = current.work_notes.getJournalEntry(1);
if (reason) {
// Remove timestamp, user name and "(Work notes)" header
reason = reason.replace(/^[^\n]*\n/, '').trim();
current.close_notes = reason;
}
}
})(current, previous);This will store only:Server reboot no longer required
instead of:2026-06-19 19:22:26 - System Administrator (Work notes) Server reboot no longer required