# Feature AUTOWORK-303 - Implement Allow-list approach for customizing List, Hierarchy and Weighted fields

Project: Stream Workflows & Automations
Status: tested
URL: https://community.openproject.org/work_packages/AUTOWORK-303

## Planning

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

## OPEN POINTS / FEEDBACK

_No work packages_

## Use cases

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

| ID | Type | Subject | Status | Assignee | Target versions | Spent time | Module |
| --- | --- | --- | --- | --- | --- | --- | --- |
| AUTOWORK-379 | Bug | Drop-down is empty if all values are made available in all projects | rejected | OP Dev Sirius Team | 18.0.0 |  | Administration / Work package administration, Administration / Custom fields |

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | Administration / Custom fields |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan | Enterprise / Premium (PRE) |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups | https://www.figma.com/design/oTMDTvcwrx35qExTkkSKBn/Custom-fields?node-id=2706-43252&t=NfjDkx4TZiGfy0A0-0 |
| Build Number |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager | Sonita Soth |
| Feature Lead | Klaus Zanders |
| Developers | Klaus Zanders |
| Designer | Parimal Satyal |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

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

## Description

**As** an Administrator  
**I want to** set up restrictions on what list custom field options are available in each project  
**so that** I can only allow certain values per project

**Acceptance criteria**

_Setting_

*   Work package custom fields of the formats List, Hierarchy and Weighted item list have a new setting &quot;Manually choose which values each project can use&quot; on their Details tab.
    
*   The setting is not offered for any other custom field class (project, user, time entry, version, group) or format.
    
*   When the setting is enabled, no values are available to any project by default. The administrator enables values for each project individually.
    
*   _~~When an administrator disables the setting on a custom field that has it enabled, a danger dialog &quot;Make all values available to all projects?&quot; asks for confirmation. Danger Dialog with a checkbox to confirm should be used.~~_ Warning banners were implemented instead.
    
*   Disabling the setting deletes all project-specific settings of the custom field. All values become available in all projects again.
    

_Projects tab_

*   Every work package custom field has a &quot;Projects&quot; tab.
    
*   It lists all active projects that use the custom field through the form of an enabled type or variant. Archived projects are not listed.
    
*   Above the list, an &quot;Important changes&quot; box explains that custom fields are no longer enabled per project, with a &quot;Learn more&quot; link to the form configuration documentation.
    
*   The list can be filtered by project name. The list updates while typing, without reloading the page.
    
*   Each row shows the project name (linking to the project) and the types that display the custom field (linking to the type).
    
*   Only when the setting is enabled:
    
    *   a &quot;Project-specific values&quot; column shows how many values are enabled for the project (e.g. &quot;3 of 12&quot;);
        
    *   an action button per row opens the project&#x27;s value configuration.
        

_Configuring the values of a project_

*   The page shows the custom field&#x27;s header and tabs. The breadcrumbs end with &quot;Project: &quot;.
    
*   A hint names the project whose values are being edited and links to it.
    
*   All values are listed with an on/off toggle that saves immediately. Hierarchy and weighted item list values are indented by their level, and weights are shown.
    
*   &quot;Enable all&quot; and &quot;Disable all&quot; change all values of the project at once.
    
*   Hierarchy and weighted item list:
    
    *   enabling a value also enables all of its ancestors;
        
    *   disabling a value also disables all of its descendants;
        
    *   a value is only usable if all of its ancestors are enabled as well.
        
*   The page is not available for projects that don&#x27;t use the custom field, nor for custom fields without the setting.
    

_Using restricted values_

*   When editing a work package, the custom field only offers the values enabled for the work package&#x27;s project. This applies to single and multi select, the inline edit and the bulk edit.
    
*   When a work package is moved or copied to another project, values not enabled in the target project are removed. Copying within the same project keeps all values.
    

_Hiding values that are not enabled_

*   A value a work package already has stays stored, even if it is no longer enabled in its project. It is displayed as &quot;(Value no longer available)&quot; everywhere the value is shown:
    
    *   work package views and the table;
        
    *   the activity/journal;
        
    *   exports (PDF, CSV, XLS);
        
    *   search results;
        
    *   subject patterns;
        
    *   the API, where the value is returned as an undisclosed link with that title.
        
*   Saving a work package that sends the undisclosed value back (unchanged) keeps the saved value.
    
*   Grouping by the custom field puts such values into a single &quot;(Value no longer available)&quot; group that is shown last. Sorting by the custom field also sorts them last.
    
*   The value lists in work package filters (UI and API filter schema), and the values the dropdown contains are values enabled in at least one project where the user can view work packages and which uses the custom field. Administrators see all values.
    
*   Global work package search does not find work packages through values that are not
    

**Technical notes**

*   The mode is stored on the custom field (`project_specific_value_restriction`. Only `nil` and `allow` can currently be set; `block` (blocklist) is prepared in the data model.
    
*   Enabled values are stored as `CustomField::ProjectSpecificValueRestriction` rows (list/hierarchy item + restriction mode). Switching the mode deletes all rows of the field.
    
*   Usable values are computed in SQL per project (`CustomField::ProjectSpecificValues`), so restrictions of different projects never combine into making a value usable.
    
*   Changing values touches the custom field, which invalidates cached work package repy of the filter schema includes the visible values.
    
*   Toggles are handled by `CustomFields::ProjectSpecificValues::SetService`, `EnableAllService`.
    
*   The checkbox confirmation uses a new generic `checkbox-confirmation` Stimulus controller.
    

**Permissions and visibility considerations**

*   _To whom is this feature visible?_
    
    *   Configuring the setting, the Projects tab and the values per project are only available to administrators.
        
    *   The restricted values: all users, in the context of the work package&#x27;s project.
        
*   _When is it not visible?_
    
    *   The setting is not shown for custom fields other than work package List, Hierarchy and Weighted item list fields.
        
    *   The &quot;Project-specific values&quot; column, the action button and the values page are not shown when the setting is disabled.
        

**Translation considerations**

*   _Key terms and phrases in the key languages_
    
    *   &quot;Manually choose which values each project can use&quot;
        
    *   &quot;Project-specific values&quot;
        
    *   &quot;(Value no longer available)&quot;
        
    *   &quot;Make all values available to all projects?&quot;
        
    *   &quot;Enable all&quot; / &quot;Disable all&quot;
        

**Out of scope**

*   Blocklist mode (all values available, administrators block individual values per project)
    
*   Configuring the values in the project settings, and delegating the configuration to project administrators
    
*   Respecting restrictions in automations
    
*   Search box and hint on the Projects tab beyond filtering by project name
