# Bug COMMS-890 - Cleanup job can delete Attachments uploaded to a new work package when attachments drag and drop field is missing during the upload 

Project: Stream Communicator
Status: closed
URL: https://community.openproject.org/work_packages/COMMS-890

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module | Modules and project features / Attachments, Modules and project features / Work packages, Modules and project features / Text editor / CKEditor5 |
| Target versions | 17.9.0 |
| Observed in versions | 17.5.0 |
| Sprint | Sprint 14 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 17.5.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Kabiru Mwenja |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Disable &#x27;Show attachments in the work packages files tab&#x27; in your project setting
    
2.  Go to work package list
    
3.  Click on create and select task
    
4.  Use the &#x27;Upload image from computer&#x27; button in Ckeditor to upload an image
    
5.  Save the work package
    

### What is the buggy behavior?

*   When Saving the work package the attachment is missing in the payload of the `POST /api/v3/work_packages` instead an empty array is send:
    

```json
{
  "subject": "Test",
  "scheduleManually": true,
  "startDate": null,
  "dueDate": null,
  "estimatedTime": null,
  "duration": null,
  "ignoreNonWorkingDays": false,
  "percentageDone": null,
  "storyPoints": null,
  "_meta": {
    "validateCustomFields": true
  },
  "customField1": null,
  "customField2": null,
  "customField8": null,
  "customField110": null,
  "customField121": {
    "raw": ""
  },
  "_links": {
    "category": {
      "href": null
    },
    "type": {
      "href": "/api/v3/types/1",
      "title": "Task"
    },
    "priority": {
      "href": "/api/v3/priorities/8",
      "title": "Normal"
    },
    "project": {
      "href": "/api/v3/projects/127",
      "title": "%Complete Test"
    },
    "projectPhase": {
      "href": null
    },
    "projectPhaseDefinition": {
      "href": null
    },
    "status": {
      "href": "/api/v3/statuses/1",
      "title": "New"
    },
    "responsible": {
      "href": null
    },
    "assignee": {
      "href": null
    },
    "version": {
      "href": null
    },
    "parent": {
      "href": null
    },
    "sprint": {
      "href": null
    },
    "customField3": {
      "href": null,
      "title": null
    },
    "customField7": {
      "href": null,
      "title": null
    },
    "customField113": {
      "href": null,
      "title": null
    },
    "self": {
      "href": null
    },
    "attachments": [],
    "fileLinks": []
  },
  "description": {
    "raw": "<img class=\"op-uc-image op-uc-image_inline\" src=\"/api/v3/attachments/42467/content\">"
  }
}
```

*   The attachment gets not container when the WP is saved
    
*   Because of the missing container the `Attachments::CleanupUncontaineredJob` will delete the attachment
    

### What is the expected behavior?

1.  The attachment gets a container and is not deleted
    
    <br>
