Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IBM
CN
Last activity: 15 Oct 2024 0:07 EDT
Copy attachments files btw cases
May I know any way to copy attachments from a case to another case?
We hope the file content is copied instead of just a "link" or "reference", thanks.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 13 Oct 2024 8:49 EDT
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-02/bbed3e6b-b104-4ff7-af74-b2b62c710bae.jpg?h=4a7d1ed4&itok=nHV3ilAn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-02/bbed3e6b-b104-4ff7-af74-b2b62c710bae.jpg?h=4a7d1ed4&itok=nHV3ilAn)
Bits in Glass
IN
@MaxonL16591286 you can use pxLinkAttachmenttocase ootb activity.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689945000/e1483e61-b75a-4a21-b945-24989ca71d03.jpg?itok=76-ACh4t)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689945000/e1483e61-b75a-4a21-b945-24989ca71d03.jpg?itok=76-ACh4t)
NCS Pte. Ltd
SG
Hi @MaxonL16591286: If you are using the OOTB Attachment widget, it has capability to add attachment from an existing case. Please note that this will work using links which wouldn't copy the file stream instead just create a link.
Is there any specific reason you need the file contents (stream data) to be cloned for each case? In this case, you may need to write your own logics to copy the contents from the existing instance to new instance.
Thanks.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IBM
CN
My reason is, we hope the file in a case still exist even it's deleted in another case.
Anyway let's try your solution. Is "the OOTB Attachment widget" an activity?
We hope copy file via activity/data transform.
Thanks.
Accepted Solution
Updated: 13 Oct 2024 8:49 EDT
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-02/bbed3e6b-b104-4ff7-af74-b2b62c710bae.jpg?h=4a7d1ed4&itok=nHV3ilAn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-02/bbed3e6b-b104-4ff7-af74-b2b62c710bae.jpg?h=4a7d1ed4&itok=nHV3ilAn)
Bits in Glass
IN
@MaxonL16591286 you can use pxLinkAttachmenttocase ootb activity.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IBM
CN
I can use pxLinkAttachmentToCase to add a file from case B to case A.
However, after it's added, it can not be downloaded from case A with msg:
"Unable to open the attachment_You lack the required permission"
Any idea? Thanks.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-02/bbed3e6b-b104-4ff7-af74-b2b62c710bae.jpg?h=4a7d1ed4&itok=nHV3ilAn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-02/bbed3e6b-b104-4ff7-af74-b2b62c710bae.jpg?h=4a7d1ed4&itok=nHV3ilAn)
Bits in Glass
IN
@MaxonL16591286 please check if any security restrictions are applied using access when or ARO or ABAC or attachment category rule.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IBM
CN
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-02/bbed3e6b-b104-4ff7-af74-b2b62c710bae.jpg?h=4a7d1ed4&itok=nHV3ilAn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-02/bbed3e6b-b104-4ff7-af74-b2b62c710bae.jpg?h=4a7d1ed4&itok=nHV3ilAn)
Bits in Glass
IN
@MaxonL16591286 this is the ootb activity to copy file. It creates a link in the backend and hence attaches to case.
You can also do create a link page and save it on link-attachment, but that's also same.
The permission issue is the security restriction on the attachments. Need to check where that restriction comes from.
Once check if the attachment in the actual case has any category and if yes check the same in the copied case.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IBM
CN
this is the ootb activity to copy file --> do you still refer to pxLinkAttachmentToCase ?
I had checked that a file "copied" by this activity to new case actually is still pointing to the file in source case ( because the ref key of DATA-WORKATTACH-FILE in new case still includes source case ID).
Actually we want to a "real" copy, just like we manually download the file from source case and upload it to new case, after this no any relationship to btw new and source case.
Thanks.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IBM
CN
Thanks for your remind
"Once check if the attachment in the actual case has any category and if yes check the same in the copied case."
I solve the lack permission issue and the case "link" by pxLinkAttachmentToCase can be downloaded in new case now after I define the attachment category to it.
However the case ID in downloaded file name still source case ID, showing they still have "link".
So please still help how about "real copy" just like we manually download the file from source case and upload it to new case
thanks.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-02/bbed3e6b-b104-4ff7-af74-b2b62c710bae.jpg?h=4a7d1ed4&itok=nHV3ilAn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-02/bbed3e6b-b104-4ff7-af74-b2b62c710bae.jpg?h=4a7d1ed4&itok=nHV3ilAn)
Bits in Glass
IN
@MaxonL16591286 in that case you need new instance of Data-workattach-File too. You need to write a custom activity for this.
Logic is
1. Have a new page of Data-workattach-File
2. Copy required properties and override required properties(eg- pzinskey of case).
3. Link this Data-workattach-File and new case by adding a new instance to Link-attachment.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IBM
CN
noted, may try, thanks.