- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 07:44 AM
Hi,
In my organization, having a Record producer called "HR Leave of Absence form", When user submits a record producer in portal, HR case will be created. In the HR Case, the description field (rich_description) field filled with "<br>" HTML tag instead of "\n" due to below line of code in "hr_CaseUtils" OOTB Script include:
this._case.rich_description = description.replace(/\n/g,"<br>");
We have raised a HI case for this issue.
if(current.operation() == 'insert' && !gs.nil(current.getValue('description')))
return;
current.description = current.rich_description;
})(current, previous);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 08:14 AM
Hi,
You can update the when to run condition in your business rule. Keep original script as it is and update when to run condition like HR Service IS NOT 'Leave of Absence'.
Create another business rule with the script part as suggested by ServiceNow Hi team, for this Busieness rule you need to add when to run condition so that it will only run for your HR Service "Leave of Absence".
When to run condition would be:
Existing condition
AND
HR Service IS "Leaveof Absence"
Changing script include is not best practice, instead you can achieve this by updating existing BR condition and creating new for BR for your HR Service.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2024 03:03 AM
Hi @Anil Lande ,
Thank you for your response. Finally I have fulfilled my requirement with your code.
With Regards
P. Sivakrishna

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 08:14 AM
Hi,
You can update the when to run condition in your business rule. Keep original script as it is and update when to run condition like HR Service IS NOT 'Leave of Absence'.
Create another business rule with the script part as suggested by ServiceNow Hi team, for this Busieness rule you need to add when to run condition so that it will only run for your HR Service "Leave of Absence".
When to run condition would be:
Existing condition
AND
HR Service IS "Leaveof Absence"
Changing script include is not best practice, instead you can achieve this by updating existing BR condition and creating new for BR for your HR Service.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2024 03:03 AM
Hi @Anil Lande ,
Thank you for your response. Finally I have fulfilled my requirement with your code.
With Regards
P. Sivakrishna