on Hold reason
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2023 12:45 AM
In every change of the On hold reason field (at that moment even before saving) - the label of the "On hold reason" field is copied to the "Short description" field.
Thank you!
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2023 01:17 AM
Hi @yardenKrispel,
Try this script in before Business Rule. Condition = On Hold reason changes:
(function executeRule(current, previous /*null when async*/) {
var short_description = current.getValue('short_description');
var new_short_description;
var new_hold_reason = current.getDisplayValue('hold_reason');
var previous_hold_reason = previous.getDisplayValue('hold_reason');
if (new_hold_reason && previous_hold_reason ){
new_short_description = short_description.replace(/\[(.*?)\]/,'['+new_hold_reason+']');
}
else if (new_hold_reason && !previous_hold_reason){
new_short_description = '[' +new_hold_reason + ']' + short_description;
}
else if (!new_hold_reason && previous_hold_reason){
new_short_description = short_description.replace(/\[(.*?)\]/,'');
}
current.short_description = new_short_description;
})(current, previous);
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2023 01:34 AM
Hi!
Unfortunately it doesn't work!

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2023 06:16 AM
Hi @yardenKrispel,
What exactly doesn't work for you? It works like a charm in my instance.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.