# Bug OP-12623 - Bulk Edit: Setting parent to a string causes 500 when backlogs active

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Work packages |
| Target versions | 17.3.0 |
| Observed in versions |  |
| Sprint | 17.3.0 |
| 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 | Mir Bhatia |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### Steps to reproduce

*Please write down the steps to reproduce. Try to write down all necessary preconditions (what permissions do you have, are other users involved?). Example:*

1.  Have a project with work packages and backlogs module active

2.  Have at least three work packages

3.  Select and bulk edit two work packages

4.  Enter a string into the parent, which is NOT the ID (reproducible with \#ID as well).

### What is the buggy behavior?

*Please describe the bug in as much detail as possible. Example:*

  - Internal error returned

### What is the expected behavior?

*Describe how the application should behave like. Example:*

1.  Regular error is shown that parent cannot be found

### **Logs**

``` text
ERROR -- : [1684409132_8331487_9b86138a_acb7_4de6_ab96_545d0c958cbe] user=2 tenant=1684409132_8331487_9b86138a_acb7_4de6_ab96_545d0c958cbe shard=multitenancy-trials1 undefined method `ancestors' for nil:NilClass: undefined method `ancestors' for nil:NilClass
[NoMethodError] undefined method `ancestors' for nil:NilClass: modules/backlogs/lib/open_project/backlogs/patches/set_attributes_service_patch.rb:73:in `ancestor_chain'; modules/backlogs/lib/open_project/backlogs/patches/set_attributes_service_patch.rb:52:in `closest_story_or_impediment'; modules/backlogs/lib/open_project/backlogs/patches/set_attributes_service_patch.rb:43:in `set_attributes'; app/services/base_services/set_attributes.rb:44:in `perform'; app/services/base_services/base_callable.rb:40:in `block in call'; app/services/concerns/with_reversible_state.rb:53:in `assign_state'; app/services/base_services/base_callable.rb:39:in `call'; app/services/base_services/write.rb:60:in `set_attributes'; app/serv
```

###
