copy from inciden task 'close notes' to parent incident worknotes

tushar_ghadage
Tera Contributor

Hi All , 

I am trying to copy close notes from incident task (when its close complete) to parent incident record in worknotes.

 

here is the before update with condition close notes changes business rule is used: 

 

(function executeRule(current, previous /*null when async*/ ) {

    // Add your code here
    var lastWorkNote = current.close_notes.getJournalEntry(-1);

    var parentInc = new GlideRecord('incident');
    parentInc.addQuery('sys_id', current.parent_incident);
    parentInc.query();

    if (parentInc.next()) {
        parentInc.work_notes = lastWorkNote;
        parentInc.update();
    }

})(current, previous);
 
but its not getting copied as expected , please help me out !!
17 REPLIES 17

not working 

Hi @tushar_ghadage ,

could you please share the screenshots of the configuration you've done?
the BR is on incident_task table only right?

whenever there is a change of close notes in the incident_task table the corresponding incident's work notes should be update correct?

 

you can have an after update BR on incident task table with the shared script

 

 

ChaitanyaILCR_4-1743558708846.png

 

ChaitanyaILCR_1-1743558479632.pngChaitanyaILCR_2-1743558531400.pngChaitanyaILCR_3-1743558559169.png

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

hi @Chaitanya ILCR , 

thanks for you reply , its on incident_task table ,

i tried here are the SS : 

Screenshot (15).pngScreenshot (16).png

Hi @Chaitanya ILCR , 

i tried the same thing but its not working its on incident_task table : 

Screenshot (16).pngScreenshot (15).png

Hi @tushar_ghadage 
Please let me know if the issue persists, and if you can share the screenshots of the configuration that would help me rectify the problem.

Thanks!