- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 02:42 PM - edited 04-04-2023 03:18 PM
The below BR is working as expected but it's copying the transcription twice in the work notes of the incident.
We want copy the chat transcript from the interaction record to comments field of the related incident .
We have written an After BR on interaction table
Condition : Transcript is not empty
(function executeRule(current, previous /*null when async*/ ) {
var inc = new GlideRecord('interaction_related_record');
inc.addQuery('interaction', current.sys_id);
inc.addQuery('document_table', 'incident');
inc.addQuery('type', 'task');
inc.query();
while (inc.next()) {
var incident = new GlideRecord('incident');
incident.addQuery('sys_id', inc.document_id);
incident.query();
while (incident.next()) {
incident.comments = current.transcript.toString();
incident.update();
}
}
})(current, previous);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 07:17 PM
Hi,
I believe you need to change the when to run condition.
It will make sure to run BR only when interaction is closed. At this moment your Business rule is running every time when the transcript changes.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 09:36 AM
I created a flow to do this and it works well.