- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 09:05 AM
Have a business rule where I'm trying to convert the HTML to text on INCs but it's not working. Here's my code.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var now_GR = new GlideRecord("incident");
now_GR.addQuery("sys_id", current.sys_id);
now_GR.query();
if (now_GR.next()) {
now_GR.work_notes.setJournalEntry(current.description);
now_GR.update();
}
})(current, previous);
Does current.field not work in business rules?
Solved! Go to Solution.
- Labels:
-
Event Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 10:51 AM
You don't need to gliderecord your incident, if you are only planning to update the work notes, make sure your BR is Before Insert/Update
Just one line you need to add:
current.work_notes.setJournalEntry(current.description);
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 09:19 AM
Hi Patrick
Try this logic in your BR
(function executeRule(current, previous /*null when async*/ ) {
current.work_notes.setJournalEntry(current.description);
current.update();
})(current, previous);
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 10:51 AM
You don't need to gliderecord your incident, if you are only planning to update the work notes, make sure your BR is Before Insert/Update
Just one line you need to add:
current.work_notes.setJournalEntry(current.description);
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 11:26 PM
You simply have to write before business rule. For your quick reference I am adding screen shot of before BR.
and into the script part your just to add one line only.
current.work_notes.setJournalEntry(current.description);
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful for you!
-Vijendra