# Feature OP-19824 - Give users the choice to not include descendants when deleting work packages

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-19824

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Target versions | 17.9.0 |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | Modules and project features / Work packages |
| Feature Flag |  |
| Requires doc change | Yes |
| Enterprise plan | Community (COM) |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Feature Lead |  |
| Developers | Mir Bhatia |
| Designer | Parimal Satyal |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**Context**

Currently, deleting a work package also deletes all of its descendants. There were some edge cases that were not handled properly but which were addressed in <mention class="mention" data-id="76930" data-type="work_package" data-text="##OP-19734" data-display-id="OP-19734">\#\#OP-19734</mention>.

However, the current approach simply doesn't offer the user the possibility to simply delete the selected work package(s), without including the descendants. This would be useful, especially in cases when the descendants are visible or accessible to that user.

**Acceptance criteria**

  - When a user tries to **delete a work package with descendants**, show a dialog:
    
      - Title: "Delete all descendants too?"
    
      - Text: "This work package has descendants. Do you want to delete them as well?"
    
      - Radio group:
        
          - Option 1: "Delete just this work package"
            
              - Caption: "This will not delete descendants but will remove hierarchical relations."
        
          - Option 2: "Delete this work package and descendants"
            
              - Caption: "This will delete all child work packages visible to you. You will have a chance to review the full list in the next step."
    
      - Actions:
        
          - "Delete" (danger)
        
          - "Cancel" (secondary)

  - When a user tries to **bulk-delete a number of different work packages and some or all have descendants**, show a dialog:
    
      - Title: "Delete all descendants too?"
    
      - Text: "You are trying to delete work packages that have descendants. Do you want to delete them as well?
    
      - Radio group:
        
          - Option 1: "Delete just the selected work packages"
            
              - Caption: "This will not delete descendants but will remove hierarchical relations."
        
          - Option 2: "Delete the selected work packages and their descendants"
            
              - Caption: "This will delete all child work packages visible to you. You will have a chance to review the full list in the next step."
    
      - Actions:
        
          - "Delete" (danger)
        
          - "Cancel" (secondary)

  - In either case, if the user picks option 2 (i.e, to also delete descendants), and some descendants are either not visible to the user, or the user doesn't have the necessary permissions to delete them, show a second dialog to provide more contextual information.
    
      - These dialogs were already implemented in <mention class="mention" data-id="76930" data-type="work_package" data-text="##OP-19734" data-display-id="OP-19734">\#\#OP-19734</mention>

**Technical notes**

  - 
    <br>

**Permissions and visibility considerations**

  - *Check if permissions and visibility conditions need to be reviewed (in relation to those covered in <mention class="mention" data-id="76930" data-type="work_package" data-text="#OP-19734" data-display-id="OP-19734">\#OP-19734</mention>)*

**Translation considerations**

  - *Use existing translation strings as much as possible*

**Out of scope**

  - 
    <br>
