How can I copy agent chat transcript to incident work note?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2021 03:51 PM
Is there any way to copy the interaction transcript to the Incident work notes? I tried the below-mentioned code in create incident UI action on interaction table and not working. And I am also trying to move the attachments attached in the chat to incident tickets. Please let me know how to solve these issues.
if(current.update()){
var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.opened_for;
inc.work_notes = current.transcript;
inc.contact_type = current.type;
inc.short_description = current.short_description;
action.openGlideRecord(inc);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2023 04:26 PM
Hi Nayan,
Thanks for your quick response.
I tried that condition and below script . Unfortunately, it didn't copy the transcript to the Incident.. Before it was getting copied twice.
(function executeRule(current, previous /*null when async*/ ) {
var query = "document_table=incident^interaction.number=" + current.number;
var irc = new GlideRecord("interaction_related_record");
irc.addEncodedQuery(query);
irc.query();
if (irc.next()) {
var inc = new GlideRecord("incident");
if (inc.get(irc.task.sys_id)) {
inc.comments = current.transcript + "";
inc.update();
}
}
// 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()) {
// gs.addInfoMessage("test");
// var incident = new GlideRecord('incident');
// incident.addQuery('sys_id', inc.document_id);
// incident.query();
// while (incident.next()) {
// //incident.comments = current.transcript;
// incident.comments = current.internal_transcript.toString();
// incident.update();
// }
// }
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2023 04:57 PM
I got it actually my requirement was different. You please change the the BR to a "Before" BR with below conditions and make sure you close the conversation in the virtual agent. Thanks.
Regards,
Nayan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2023 05:08 PM
I tried but it didn't worked.
The condition with before also didn't trigger the BR.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2023 10:14 AM
Could you please make sure that you are ending the virtual agent conversation chat. You can check that on the conversation table as well. Thanks.
Regards,
Nayan