- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 06:58 AM
When someone adds and attachment in the VA after connecting to a Live Agent, those attachments are not being added to the Interaction record.
How are attachment to be moved over to the associated record(s) systematically?
FYI, we were able to create a solution with Connect chat, to sync attachments. But without a hard link to the interaction record, this seems to be challenging.
Solved! Go to Solution.
- Labels:
-
Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 11:33 AM
I found a solution.
After the Transcript has posted, BR to:
From Interaction Record, grab the channel_metadata_document ID if the channel_metadata_table is sys_cs_conversation, then query sys_cs_conversation_task table where conversation is the value in channel_metadata_document. in While statement, if record has an attachment then query the interaction_related_record(s) that are in scope for the attachment copy, use the standard copy attachment script. Outlined below:
var xstrCon = current.channel_metadata_document;
if (!JSUtil.nil(xstrCon)) {
var message = new GlideRecord('sys_cs_conversation_task');
message.addQuery('conversation', current.channel_metadata_document);
message.setLimit(10);
message.query();
while (message.next()) {
var xbolAtt = message.hasAttachments();
gs.print('Has Message:' + xbolAtt);
if (xbolAtt == true) {
xobjList = new GlideRecord('interaction_related_record');
xobjList.addQuery('interaction', current.sys_id);
xobjList.addNotNullQuery('task');
xobjList.setLimit(5);
xobjList.query();
while (xobjList.next()) {
GlideSysAttachment.copy('sys_cs_conversation_task', message.sys_id, xobjList.task.sys_class_name, xobjList.task.sys_id);
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 11:33 AM
I found a solution.
After the Transcript has posted, BR to:
From Interaction Record, grab the channel_metadata_document ID if the channel_metadata_table is sys_cs_conversation, then query sys_cs_conversation_task table where conversation is the value in channel_metadata_document. in While statement, if record has an attachment then query the interaction_related_record(s) that are in scope for the attachment copy, use the standard copy attachment script. Outlined below:
var xstrCon = current.channel_metadata_document;
if (!JSUtil.nil(xstrCon)) {
var message = new GlideRecord('sys_cs_conversation_task');
message.addQuery('conversation', current.channel_metadata_document);
message.setLimit(10);
message.query();
while (message.next()) {
var xbolAtt = message.hasAttachments();
gs.print('Has Message:' + xbolAtt);
if (xbolAtt == true) {
xobjList = new GlideRecord('interaction_related_record');
xobjList.addQuery('interaction', current.sys_id);
xobjList.addNotNullQuery('task');
xobjList.setLimit(5);
xobjList.query();
while (xobjList.next()) {
GlideSysAttachment.copy('sys_cs_conversation_task', message.sys_id, xobjList.task.sys_class_name, xobjList.task.sys_id);
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 10:49 PM
On what table we need to write the BR