- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 11:35 AM
Hi All,
how can we copy worknotes from Interaction to Incident on agent workspace?
I tried editing with below UI Action yet no luck, can someone help me with this.
if(current.update()){
var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.opened_for;
inc.short_description = current.short_description;
var worknotes = inc.work_notes.getJournalEntry(1);
//inc.work_notes = current.work_notes;
worknotes = current.work_notes;
action.openGlideRecord(inc);
}
Thank you.
Regards,
Meenal
Solved! Go to Solution.
- Labels:
-
Agent Workspace
- 5,842 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2021 06:23 AM
Hello,
For those who wants the solution :
- Create a business rules on the table "interaction_related_record", before insert with order of 400 and copy this code :
(First part has been taken from another OOB business rules, it's because BR run twice on insert ....)
var existingRelationship = new GlideRecord("interaction_related_record");
existingRelationship.addQuery("interaction", current.interaction);
existingRelationship.addQuery("document_id", current.document_id);
existingRelationship.setLimit(1);
existingRelationship.query();
if (existingRelationship.next()) {
current.setAbortAction(true);
}else{
var grTask = new GlideRecord(current.document_table);
grTask.get(current.document_id);
grTask.work_notes = current.interaction.work_notes.getJournalEntry(-1);
grTask.update();
var attachment = new GlideSysAttachment();
attachment.copy('interaction', current.interaction.sys_id, current.document_table, current.document_id);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2020 08:39 AM
I had thought I had struck gold but your solution did not work for me (but it led me in the right direction).
As is, not only did the work_notes fail to move over but it failed to show the new Incident (it created it in the background... which may have been the intent).
I finally got the following to work for me:
if(current.update()){
var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.opened_for;
inc.short_description = current.short_description;
inc.location = current.opened_for.location;
var notes = current.work_notes.getJournalEntry(-1);
inc.description = "Copied notes ::\n" + notes;
action.openGlideRecord(inc);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2021 06:23 AM
Hello,
For those who wants the solution :
- Create a business rules on the table "interaction_related_record", before insert with order of 400 and copy this code :
(First part has been taken from another OOB business rules, it's because BR run twice on insert ....)
var existingRelationship = new GlideRecord("interaction_related_record");
existingRelationship.addQuery("interaction", current.interaction);
existingRelationship.addQuery("document_id", current.document_id);
existingRelationship.setLimit(1);
existingRelationship.query();
if (existingRelationship.next()) {
current.setAbortAction(true);
}else{
var grTask = new GlideRecord(current.document_table);
grTask.get(current.document_id);
grTask.work_notes = current.interaction.work_notes.getJournalEntry(-1);
grTask.update();
var attachment = new GlideSysAttachment();
attachment.copy('interaction', current.interaction.sys_id, current.document_table, current.document_id);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2021 01:00 AM
It works like a charm.
Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2021 10:44 AM
These methods both work to copy the attachment, but work notes are not copying for me in Quebec.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2021 11:21 PM
It works for me in Quebec. You probably need to add Notes section for the worknotes to be visible.
Configure -> Form Design to show Comments and worknotes activity