Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to remove the HTML tag in the Work Notes

45120164
Giga Contributor

For an Incident, when I add text in Summary, Findings and Timeline, HTML tags come up in the worknotes.

45120164_0-1697089125388.png

 

Capture.PNG


Can someone help me with this? Thanks in advance.

1 REPLY 1

Anand Kumar P
Giga Patron

Hi @45120164 ,

Create business rule on incident created or updated 

(function executeRule(current, previous) {
    var description = current.description;
    var plainTextDescription = description.replace(/<[^>]+>/g, ''); 
    current.work_notes = plainTextDescription;
})(current, previous);

Please mark it solution proposed and helpful if it works.

Thanks,

Anand