REST API for getting CustomField definitions
|Assignee:||Jean-Philippe Lang||% Done:|
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:
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:
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>
#1 Updated by Ruediger Schobbert over 8 years ago
Since this probably takes a while, until it is integrated in redmine, I wrote a little webapp (in groovy, because I only have minimal ruby/redmine knowhow) to serve the customfields.
If anyone is interested they may have a look on github: https://github.com/rschobbert/redmine-customfield-info
#4 Updated by Jaap de Haan about 7 years ago
+1 too, as filtering is possible on the issues with (nnn being the field id),
there should be at least a way to programmatically figure out what are the fields and which ids they have. (At the moment there is only a dirty workaround by examinating the contents of a ticket, by hoping the wanted fields are present)
My proposal would be to extend the
project query by adding one
include option (beside
fields for example) For a first shot this does not need to be too complicated, having the field names, ids, tpyes and if they are required or not would be already great.
#8 Updated by Jean-Philippe Lang about 7 years ago
- Subject changed from REST API - query CustomField Definitions to REST API for getting CustomField definitions
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Target version set to 2.4.0
- Resolution set to Fixed