Interaction Info & Attachments Don't Transfer to HR Case

MollyMoney
Tera Contributor

Hi, 

In our HRSD application, we want to utilize interactions for Voicemails - i.e., a voicemail is received to our HR service desk and an interaction is created with VM file attached. Then the agent can listen to the VM and determine if a new case needs to be created (and what type of case) or if they should associate that interaction to an existing case. However when we try to create an HR case from the interaction, the VM attachment and the information noted on the interaction doesn't get transferred to the HR case. We have tried multiple things and haven't been able to figure out how to get this to work. Has anyone else run into this issue? Have you found a solution?

2 REPLIES 2

Jennifer Thurin
Tera Contributor

following

Community Alums
Not applicable

Hi  @MollyMoney , 

For a similar issue of chat transcript and attachments not transferring from interaction to HR case, we wrote the following business rules: 

1. When HR case gets created after the interaction is closed/ended because transcript field  in interaction record gets populated only when interaction is closed.

    Table : Interaction_related_record

    when to run : After - Insert

    

anu21_0-1707902798092.png

 

Script :

(function executeRule(current, previous) {
var gr_interaction = new GlideRecord("interaction");
        gr_interaction.addQuery('sys_id', current.interaction);
        gr_interaction.query();
        if (gr_interaction.next()) {
var g_hrcase=new GlideRecord("sn_hr_core_case");
   g_hrcase.get(current.document_id);
           g_hrcase.work_notes.setDisplayValue(gr_interaction.transcript);
   GlideSysAttachment.copy('interaction', current.interaction, 'sn_hr_core_case', current.document_id);
g_hrcase.update();
         }
})(current, previous);
 
 
2. When HR case is created when interaction is work in progress or ongoing   

     Table : Interaction

    when to run : After - update

anu21_1-1707903047270.png

 

 script:
(function executeRule(current, previous ) {
var gr = new GlideRecord("interaction_related_record");
gr.addQuery('interaction', current.sys_id);
gr.addEncodedQuery("taskSTARTSWITHHRC");
gr.query();
while(gr.next()){
var g_hrcase=new GlideRecord("sn_hr_core_case");
g_hrcase.get(gr.document_id);
g_hrcase.work_notes.setDisplayValue(current.transcript);
GlideSysAttachment.copy('interaction', current.sys_id, 'sn_hr_core_case', gr.document_id);
        g_hrcase.update();
        }
})(current, previous);
 

Let me know if this helps!

 

 Regards,

Anu