- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 07:10 AM
I'm trying to use the below script I found to copy the Virtual Agent conversation into the incident that was created from it. It's copying the conversation into the incident twice and I'm not sure why. Does anyone have any idea?
(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();
gs.log('Incident updated with transcript');
}
}
})(current, previous);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 01:37 AM
Hello @chrish5
Please refer to the KB article here - "Chat Transcript" in Agent chat
As per the platform design, it is not intended to copy the transcript from the interaction to the incident.
However, we have other community posts where this has been achieved via customization.
Request you to evaluate your script based on the solutions provided here:
- How can I copy agent chat transcript to incident work note?
- Copy Chat transcript from interaction to related incident
- Agent Chat - Copy Interaction to Incident

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 01:37 AM
Hello @chrish5
Please refer to the KB article here - "Chat Transcript" in Agent chat
As per the platform design, it is not intended to copy the transcript from the interaction to the incident.
However, we have other community posts where this has been achieved via customization.
Request you to evaluate your script based on the solutions provided here:
- How can I copy agent chat transcript to incident work note?
- Copy Chat transcript from interaction to related incident
- Agent Chat - Copy Interaction to Incident