# Feature OP-4546 - Complete support of  CustomFieldFormat registration

Project: OpenProject
Status: new
URL: https://community.openproject.org/work_packages/OP-4546

## Planning

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

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## 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

Plugins can create new CustomFieldFormats, register them and allow administrators to create CustomFields of the new type. This works.  
But, if such CustomField is put into WorkPackage, then:

1.  in the standard edit form text input field is displayed instead of a list
2.  in the HAL+JSON type information CustomField has no type information and is missing in the \_links hash;
3.  filter list produces 500 error stating “caught error of type ArgumentError in after callback inside Grape::Middleware::Formatter : Filter Queries::Filters::Shared::CustomFields::Base does not map to a dependency representer.” because other formats are forced into Base which always raises ArgumentError.

Also, the code contains hardcoded support for version and user formats. Anything else require patching. This can be problematic if at least two independent plugins will try to register their formats.

Therefore the idea is to extend CustomFieldFormat structure with extra fields and:

1.  all code fragments where case returns constants change into lookup in that structure
2.  all code fragments where case on type involves more complex block of code rewrite to use method in CustomField or related class
3.  fix other problems which prevent writing plugin with new CustomFieldFormat.

Also I found no documentation how to develop new CustomFieldFormats or even a working example in some plugin.
