Need help to copy attachment from Child case to Parent case

VShine
Mega Guru

Hello Experts,

We have special use case where we have Parent & child case stored in same HR table. 

I need to copy attachment from child case (hr performance case table) to parent case (on HR performance case table).

I see multiple community posts where copy from one table to another. But I couldn't find help on copying attachment from one record to another on same table.

1 ACCEPTED SOLUTION

Hi @vikrami 

You have to apply the logic such a way that this BR should run only once so it will copy once.

Question, When do you want to copy attachment ? which event ?

 

View solution in original post

8 REPLIES 8

@Ankur Bawiskar  and @rahulpandey -I tried both of the code & getting same response.  If I am keeping BR on Insert, attachment is not getting copied from child HR case to parent at all. If I am choosing it on update, attachment getting copied twice to the parent case.

Here is my business rule:

find_real_file.png

find_real_file.png

 

Hi,

During copy you try deleting the older ones.

GlideSysAttachment.copy() would copy all the attachments again

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @vikrami 

You have to apply the logic such a way that this BR should run only once so it will copy once.

Question, When do you want to copy attachment ? which event ?

 

VShine
Mega Guru

@rahulpandey and @Ankur Bawiskar - thank you so much....Was able to make it work by adding filter condition on When to run.