Attachment API doesn't move all attachments

joel_tan1991
Kilo Contributor

Hi,

I've been having trouble with migrating all of my attachments of a particular table to another instance (From Helsinki to Kingston). I have used the REST attachment API (POST) and created a scheduled job script to run but not all attachments are moved.

REST message:

find_real_file.png

 

Script used:

find_real_file.png

Results are as follow:

 

find_real_file.png

 

 

I went over to manually attach the particular file and was able to do so. However, I am unable to attach via REST api of another instance.

find_real_file.png

As I have posted another issue possibly similar to this, I've decided to remove it and edit it onto this post as it may be related. 

 

Any ideas on where did I go wrong or know the solution to the attachment extension issue?

Thanks

1 ACCEPTED SOLUTION

Joel,

If your target instance returns 404, isn't it simply because the record you are trying to attach the file to doesn't exist on this instance with this table_sys_id ?

View solution in original post

13 REPLIES 13

Joel,
Can you try adding some gs.log to debug your script? Make sure your first grAttach GlideRecord finds the record and provides all the correct values to your sendAttachment function.

Also, add a try/catch on the setRequestBodyFromAttachment call.

 

Hi,

I did a log for response, http status and the response body. I've logged down all grAttach variables and was able to view them. Even if the status is 404, I am able to obtain the information of variable taken from grAttach.

find_real_file.png

 

I did a try/catch but it wasn't returning any exception.

 

 

Joel,

If your target instance returns 404, isn't it simply because the record you are trying to attach the file to doesn't exist on this instance with this table_sys_id ?

I was hoping that would be the case. But unfortunately, the record exist.

I can't export them via xml it is over 32GB of data.

AH! My REST api to migrate the table records must have screwed up somehow, affecting the sys id of some records in this case.

Like you mentioned, record exist but the sys id is different. 

 

Thank you!