# Bug OP-16560 - Setting the user display format without a lastname breaks User custom fields with group values

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module |  |
| Target versions | 15.2.1 |
| Observed in versions | 15.2.0 |
| Sprint | 15.2.1 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 15.2.x |
| 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 | Kabiru Mwenja |
| 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.  Upgrade OpenProject to version 15.2.0

2.  Login as an admin user, navigate to Admin \> Users and permissions \> User settings \> Display format (select the option that includes only the *firstname- this will be shown as your own firstname*) \> Click Save

3.  Navigate to a work package that has a User custom field with multi-select option - if you do not have one, create one (please see [docs here](https://www.openproject.org/docs/system-admin-guide/custom-fields/#custom-field-formats))

4.  Attempt to assign a group as the value in the User custom field you created in (3) or to Add a comment and mention someone in the comment or try to change the assigne of the issue

5.  The error message `missing attribute 'lastname' for Group` is shown and "An internal error has occurred"

### What is the buggy behavior?

  - It is not possible to add comments to a work package

  - It is not possible to change details of the work package

  - It is not possible to change the assignee of a work package

### What is the expected behavior?

1.  Comments can be added

2.  Details and assignees can be changed

### **Logs**

Using the openproject utility, I get the following entry, when trying to add a comment to a work package:  
`Jan 28 13:10:30 openproject.intra.platomo.de openproject-web-1.service[274974]: I, [2025-01-28T13:10:30.513599 #274974]&nbsp; INFO -- : [7d22c4b7-3753-4c28-92ba-9eac1c0442e7] method=POST path=/work_packages/6776/activities format=*/* controller=WorkPackages::ActivitiesTabController action=create status=500 allocations=9473 duration=16.03 view=0.03 db=6.59 user=9`

### Screenshots and other files

<br>

*<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/290240/content">*

<br>

*<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/300381/content">*

### Environment information

**OpenProject installation type**

  - Packaged installation
    
      - Ubuntu 22.04
    
      - Installed from `https://dl.packager.io/srv/deb/opf/openproject/stable/15/ubuntu 22.04 main`

**OpenProject version**

15.2.0

**Browser**

- [x] Chrome
- [ ] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Operating System**

- [ ] Windows
- [x] Mac OS X
- [ ] Mobile iOS
- [ ] Mobile Android
- [ ] Linux (please specify distro)
- [ ] Chrome OS
- [ ] Other (please specify)

**Language**

German
