# Bug OP-14224 - Work packages: Create child fails if milestone is first selected type

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 13.2.1 |
| Observed in versions |  |
| Sprint | 13.2.1 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

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

## Planning

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

## Costs

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

## Description

### Steps to reproduce

1.  Have a project with a task
2.  Ensure that in that project, milestone is the first auto selected type (e.g., by moving it to the top in the global administration)
3.  Try to create a subtask under the task on its relation tab

### What is the buggy behavior?

*   The create form fails with an error toast
*   This is due to the milestone getting its dates and duration assigned from the parents. There are two cases of the bug which cause the SetAttributesService to fail
    *   Parent had a date set (duration &gt; 1). The milestone inherits these dates and receives an error
    *   Parent had no date set. The milestone has a duration of nil and this fails

### What is the expected behavior?

1.  The milestone can be created

###
