Copying worknotes from Incident to Task

Tahzeeb
Giga Expert

Hi All,

 

I need some help on below requirement

I need to copy work-notes from Incident to Task but with the condition that all the work-notes should be copied only at the time of Task creation and later only recent work-notes should be copied.

-Tahzeeb

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi Tahzeeb,

 

Are you trying this logic on HR Case and HR Task table? If yes, please follow the below screenshots on Human Resources : Core Scope.

 

1. BR on HR Case table:

find_real_file.png

 

find_real_file.png

 

2. BR on HR Task Table

 

find_real_file.png

 

find_real_file.png

 

 

Expected Results:

HR Task:

find_real_file.png

View solution in original post

31 REPLIES 31

Mohammad Danis1
Giga Guru

Hi Tahzeeb,

You can write an After BR, insert/update on Incident Table

Condition: current.work_notes.changes()

var gr = new GlideRecord('incident_task'); 

gr.addQuery('incident',current.sys_id); // Incident with which the task is associated

gr.query();

while(gr.next()){

gr.work_notes=current.work_notes.getJournalEntry(1);
gr.update();

}

Jaya Shah
Kilo Contributor

If there are multiple incident tasks, can we include the task number in the update copied from the incident task to the Incident?