Attach a attachment to multiple documents

Use case: I want to generate a pdf document and store it on 2 different documents (Notification Document to the user and Archive Document).

The current implementation of the attachment REST-API is as follows: I upload an attachment (not attached to any document) and get back an attachment_id. The first document updated with that id included causes the attachment to get moved on the file system from a global temp folder to a document specific one. This causes the second document update to fail, because the attachment can’t be found any longer in the temp directory.

The current semantic ist: Upload a global attachment and a document can “claim it”. After that it is no longer possible to be claimed by other documents. Is this intentional or a bug? As i want to generate a “official” pdf-document (even if it’s only a parking card at the moment) it would be nice to now, that booth the user and the archive have the same attachment and not just an equal one.

Hi Martin,
the behavior you describe is is intentional. Attachments are not global but document scoped. When you upload an attachment an ID is generated. In this step attachment is not attached to a document yet. But when you attach it to a document and save the document, then attachment is bound to this document and you can’t reference it from other doc. I see your use case and it makes sense to link attachments between multiple docs. Currently this is not possible and you have to create a new ticket.