Content
How do I associate an existing containerless attachment with a work package via API?
Started February 9, 2021 10:52 · 1 reply · 2 participants
The API documentation says:
Clients can create attachments without a container first and attach them later on.
https://docs.openproject.org/api/endpoints/attachments/#attachments-attachments
But I can't find a way to do this.
This not work:
PATCH /api/v3/work_packages/{id}
{
"lockVersion": 1,
"_links": {
"attachments": {
"href": "/api/v3/attachments/48"
}
}
}
How do I associate an existing containerless attachment with a work package via API?
Hi Dmitry,
you need to provide an array for the attachments links as multiple attachments can be provided:
{
"lockVersion": 1,
"_links": {
"attachments": [
{
"href": "/api/v3/attachments/48"
}
]
}
}
Regards,
Jens