copy chat to work note
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2024 09:02 AM
Hello Experts,
I have created a connect action to create a request through chat and copy the chat conversation to work notes.
Currently, for every chat conversation a specific journal entry is getting created in RITM worknote.
My requirement is to copy all chat conversation to a single entry in the work note of RITM.
Please help me to update the script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2024 10:53 AM - edited ‎05-16-2024 10:55 AM
@Puneet4418 Please update your script as follows and check if it works.
var id = conversation.document.sys_id;
var gr = new GlideRecord('live_group_profile');
gr.addQuery('document', id);
gr.query();
gs.log("GR Count " + gr.getRowCount(), "HelpCreateReq");
if (gr.next()) {
var reqItem = new GlideRecord('sc_req_item');
reqItem.addQuery('request', req.sys_id);
reqItem.query();
gs.log("reqItem Count " + reqItem.getRowCount(), "HelpCreateReq");
if (reqItem.next()) {
var msg = new GlideRecord('live_message');
var encQry = "group=" + gr.getValue('sys_id') + "profile.name!=ITHelpNow Chat";
msg.addEncodedQuery(encQry);
msg.setLimit(5);
msg.query();
gs.log("msg Count " + msg.getRowCount(), "HelpCreateReq");
var message = '';
while (msg.next()) { // copying the conversation notes to RITM comments
gs.log("msg: " + msg.getValue('message').toString(), "HelpCreateReq");
message = message+'\n' + msg.getValue('message').toString();
}
reqItem.work_notes =message;
reqItem.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2024 12:37 AM
Hi @Sandeep Rajput ,
It is copying all the chat in the last entry of the work note. However, Still creating entry for every chat conversation line.
mention below is an example. 1,2 & 3 are the chat conversations.
work note - 1,2,3
work note - 1,2
work note - 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2024 01:19 AM
@Puneet4418 Could you please post some screenshot highlighting the issue.