プロジェクト

全般

プロフィール

Vote #72036

完了

REST API for getting CustomField definitions

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
REST API_32
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
32
version_id:
70
issue_org_id:
11159
author_id:
57395
assigned_to_id:
1
comments:
9
status_id:
5
tracker_id:
2
plus1:
2
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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:


  
    TimeEntryCustomField
    Text
    5
    5
    [0-2][0-9]:[0-5][0-9]
    
    1
  
  
    TimeEntryCustomField
    List
    0
    
        First
        Second
    
    
    0
  


journals

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

--------------------------------------------------------------------------------
The project redmine-customfield-info on github has been deprecated in favor of the new project redmine-miss-api, which also serves the enumerations. The project can be found on github under: https://github.com/rschobbert/redmine-miss-api

--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1 too, as filtering is possible on the issues with (nnn being the field id),
<pre>
GET /issues.xml?cf_nnn=abcdef
</pre>
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 @issue_categories@ and @trackers@ also *@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.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
A patch for 'GET /custom_fields.xml' (without the filtering part) is available in #9664.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Feature added in r12165. The response is slighty different from the proposal, see [[Rest_CustomFields]].
--------------------------------------------------------------------------------
what about CRUD for custom field definitions (http://www.redmine.org/issues/9664) ?
--------------------------------------------------------------------------------


related_issues

relates,New,7819,REST API Populating issue field enumerations + Issue list filters
relates,New,9664,CRUD operations for "custom field definitions" (not setting custom fields on issues!)

Admin Redmine さんが3年以上前に更新

  • カテゴリREST API_32 にセット
  • 対象バージョン2.4.0_70 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0