map work notes from interaction to incident From "Create Incident" UI action in Agent workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2020 08:19 AM
hello
We have Create Incident UI action on interaction table in Agent Workspace.
OOB it maps couple of fields from incident to interaction, I have additional requirement to map work notes from interaction to incident.
I tried using some of below:
//inc.work_notes = current.work_notes; which is not working.
also when i used getJournalEntry(), Incident doesn't get created.
How can I achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2020 12:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2020 04:40 AM
if(current.update()){
var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.opened_for;
inc.short_description = current.short_description;
//inc.work_notes = current.work_notes;
//var wn = current.work_notes.getJournalEntry(-1);
//inc.work_notes = wn;
var gr = new GlideRecord('sys_journal_field');
gr.addQuery('element_id', current.sys_id);
gr.addQuery('element', 'work_notes');
gr.query();
while(gr.next())
{
var worknote = gr.value.toString();
>>>>>gs.info("I am testing incident work notes 12" +worknote);
}
//inc.work_notes += worknote;
//gs.info("I am testing incident work notes 34" +wn);
action.openGlideRecord(inc);
}
Here see >>>> log correctly shows the work note but when I try to do
inc.work_notes += worknote; or inc.work_notes = worknote;
Incident doesn't get created from Interaction.
Is it like action.openGlideRecord(inc); doesn't support this or Am I missing something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2020 01:47 AM
Hi,
I am also facing the same issue, Have you found a solution for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2020 07:16 AM
Hello
So to map worknotes, you can use getJournalEntry() to map worknotes.
But at the same time it will not map if Incident is not already created.
Hence add current.insert() to insert the incident in the same UI action "Create Incide".
But if you are using Agent workspace, this may lead you to creation of duplicate incidents.
Hope this helps.