Feature #44233
openAdd show, update, and destroy to the REST API for custom fields
Description
Currently, the REST API for custom field definitions only supports the index action, so individual custom fields cannot be retrieved, updated, or deleted via the API.
This proposal adds show, update, and destroy actions to the custom fields REST API. Since the show action did not previously exist, it is being added here as an API-only action, without an HTML view.
All of these actions require administrator privileges.
Files
Updated by Go MAEDA about 1 month ago
Thank you for the patch.
I noticed that the patch does not add a create action. With this patch, a custom field can be read, updated, and deleted through the API, but it cannot be created.
Is leaving out create intentional? If so, could you clarify the reason?
Updated by Mizuki ISHIKAWA 13 days ago
- File 0002-Add-REST-API-support-for-create-on-custom-fields.patch 0002-Add-REST-API-support-for-create-on-custom-fields.patch added
Is leaving out create intentional? If so, could you clarify the reason?
Thank you for pointing this out. The create API was missing, so I have attached a patch that adds it. It applies on top of the previous patch.
Even after this patch, a custom field whose field_format is enumeration can only be created and its possible values still cannot be added. In the UI as well, creating a custom field and adding its possible values are two steps on separate screens, so this is the responsibility of CustomFieldEnumerationsController rather than of the custom field create action. I think adding an API for it is better addressed separately.