Feature #44233
open
Add show, update, and destroy to the REST API for custom fields
Added by Mizuki ISHIKAWA 3 months ago.
Updated about 1 month ago.
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
- Target version set to Candidate for next major release
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?
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.
Also available in: Atom
PDF