# Feature FND-277 - Make WP categories association the canonical data source

Project: Stream workspace foundations
Status: new
URL: https://community.openproject.org/work_packages/FND-277

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 18.1.0 |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

| ID | Subject | Type | Status | Assignee | Target versions | Spent time |
| --- | --- | --- | --- | --- | --- | --- |
| FND-283 | Journal categories and show them in baseline comparison | Implementation | new |  |  |  |
| FND-284 | Keep categories consistent on project move and category deletion | Implementation | new |  |  |  |
| FND-285 | Move the category writers to categories | Implementation | new |  |  |  |
| FND-286 | Read filters, sorting and grouping from the join table | Implementation | new |  |  |  |
| FND-287 | Output all categories in exports, e-mails, reports and subjects | Implementation | new |  |  |  |
| FND-288 | Stop writing category_id and remove the WorkPackage to Category relation | Implementation | new |  |  |  |

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

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

## People

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

## Estimates and progress

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

## Description

**As a** developer of OpenProject or of an extension  
**I want to** read categories from the new model in every subsystem  
**so that** the old single category can be removed without a behavior change.

**Acceptance criteria**

  - Every read path in core and in modules reads from the join table.

  - With multiple categories off, users see no change. The UI, the API, bulk edit, copy, move, incoming e-mail, the CSV import, exports, reports and the activity behave as before.

  - The Activity tab shows which categories were added or removed. Old journal entries still render, also for deleted categories. "Only changes" shows category changes.

  - Baseline comparison shows the categories at a past timestamp.

  - Deleting a category with reassignment updates the join table without duplicate rows. The affected work packages get journal entries in the same way as for versions (<mention class="mention" data-id="FND-269" data-type="work_package" data-text="#FND-269">#FND-269</mention>).

  - Moving a work package to another project maps each category by name. A category without a match is removed, as today.

  - Saved queries and views keep their category filter, column, group-by and sort.

  - Seed data uses the new model and has the same categories as before.

  - At the end, no code writes `category_id`, and `WorkPackage` has no `belongs_to :category`.

**Technical notes**

This is a large change under the hood. The product behavior must not change.

  - Add more Implementations when you find more call sites. The versions equivalent (<mention class="mention" data-id="COMMS-845" data-type="work_package" data-text="#COMMS-845">#COMMS-845</mention>) grew to 41 Implementations this way.

  - "Stop writing category\_id" is the last Implementation. All other Implementations block it.

  - Reference: <https://github.com/opf/openproject/pull/24620>.

  - Analog: <mention class="mention" data-id="COMMS-845" data-type="work_package" data-text="#COMMS-845">#COMMS-845</mention>, <mention class="mention" data-id="COMMS-863" data-type="work_package" data-text="#COMMS-863">#COMMS-863</mention>.

**Out of scope**

  - User-facing multi-value changes (<mention class="mention" data-id="FND-278" data-type="work_package" data-text="#FND-278">#FND-278</mention>).
