How to remove the special characters" " that are added to the comment when the user raises a Incident on portal through get help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 05:43 AM
When user creating an incident through get help ,if "double space" is provided at the end of the sentence in the field "Please provide more details so we can quickly solve your problem" .The special characters" " are added to that comment in the backend.
Can anyone tell how to fix this in record producer script-
var details = producer.more_details.getDisplayValue();
details = details.replace(/<\/?[^>]+(>|$)/g, "");
details = details.replace(" ", " ");
notes += producer.more_details.getQuestion().getLabel() + ':' + '\n' + details + '\n';
Thanks in advanced.
- Labels:
-
Incident Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2022 08:17 PM
what type of variable is more_details?
var details = producer.more_details.getDisplayValue();
gs.info("My data" + details); // what came here
details = details.replace(/<\/?[^>]+(>|$)/g, "");
details = details.replace(" ", " ");
notes += producer.more_details.getQuestion().getLabel() + ':' + '\n' + details + '\n';
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader