Content
View differences
<br>
##
## Boards: where the deprecated `version` attribute actually gets written
There is no explicit `version` write in the boards code. The attribute name is
data-driven from the board query's filter id.
### Write chain (on card drop)
1. `frontend/src/app/features/boards/board/board-list/board-list.component.ts:398`
`addWorkPackage()` builds a changeset and calls:
`this.actionService?.assignToWorkPackage(changeset, query)` (line 403)
2. `frontend/src/app/features/boards/board/board-actions/board-action.service.ts:242`
The base `assignToWorkPackage` never names an attribute:
`new WorkPackageFilterValues(this.injector, query.filters, ['project'])`
`.applyDefaultsFromFilters(changeset);`
3. `frontend/src/app/features/work-packages/components/wp-edit-form/work-package-filter-values.ts`
For each `=` filter, `applyFirstValue` → `mapFilterToAttribute(filter)`, which
returns `filter.id` verbatim (only `onlySubproject` is special-cased).
Result: `changeset.setValue('version', <VersionResource>)`
4. Serializes to `_links.version` → `lib/api/v3/work_packages/work_package_representer.rb:580`
(`associated_resource :version`) → `version_id` → mirrored into a `kind: "target"`
row by `saved_change_to_version_id?` in `app/models/work_package/versions.rb:226`
The filter id is `version` because the query is built server-side:
`modules/boards/app/services/boards/version_board_create_service.rb:46` emits
`[{ version_id: { operator: "=", values: [...] } }]`, and `version_id` converts to
the API v3 name `version`.
### The actual coupling
`filterName = 'version'` at
`frontend/src/app/features/boards/board/board-actions/version/version-action.service.ts:25`
is simultaneously the query filter id **and**, via the generic path above, the
attribute written.
### Reads hanging off the same string
All three need the deprecated `version` schema entry to survive:
* `version-action.service.ts:64` — `form.schema.version.writable` (`canAddToQuery`)
* `board-action.service.ts:225` — `schema[this.filterName]` (`canMove`)
* `board-action.service.ts:234` — `changeset.isWritable(this.filterName)`
### Implications for the fix
Not a matter of swapping a `setValue` call — the filter id and the written
attribute are the same value by construction. Two options:
* **(preferred)** Move the server-side board query to a `target_versions` filter.
<br>
`filterName` becomes `targetVersions` and flows through the generic path
<br>
unchanged.
* Add a `version → targetVersions` mapping in `mapFilterToAttribute`.
The preferred option depends on the query-filter rename currently gated behind
`Setting::WorkPackageMultipleVersions` in
`app/models/queries/work_packages/selects/property_select.rb:103`, so boards may
not be independently sequenceable ahead of iteration 2.