Actions
Feature #11159
closedREST API for getting CustomField definitions
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Description
It would be helpful to have a possibility to query CustomFields for a certain type, since the customfield id and length/regex limitations might be necessary to create a valid REST API POST request.
One workaround to get the id of the customfield is to do a query for the resource first. E.g. for time_entries:
GET /time_entries.xml
will also return the customfields, but only if there is at least one time_entry in the database
If there is no time_entry yet, you can create a dummy one first (also via REST API), and delete that after you got the customfield ids. But this will not work if any of the customfields are mandatory.
This feature is probably related to Feature #9664
I suggest something like:
GET /custom_fields.xml?type=TimeEntryCustomField
which will result in the following response:
<custom_fields type="array"> <custom_field id="1" name="StartTime"> <type>TimeEntryCustomField</type> <format>Text</format> <min_length>5</min_length> <max_length>5</max_length> <regex>[0-2][0-9]:[0-5][0-9]</regex> <default_value></default_value> <required>1</required> </custom_field> <custom_field id="2" name="SomeListField"> <type>TimeEntryCustomField</type> <format>List</format> <multiple>0</multiple> <possible_values> <value>First</value> <value>Second</value> </possible_values> <default_value></default_value> <required>0</required> </custom_field> </custom_fields>
Related issues
Actions