プロジェクト

全般

プロフィール

Vote #71993

完了

REST API - custom fields in POST/PUT ignored for time_entries

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

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

0%

予定工数:
category_id:
32
version_id:
52
issue_org_id:
11112
author_id:
57395
assigned_to_id:
1
comments:
4
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
46
ステータス-->[Closed]

説明

About your application's environment
Ruby version              1.9.3 (x86_64-linux)
RubyGems version          1.8.22
Rack version              1.1.3
Rails version             2.3.14
Active Record version     2.3.14
Active Resource version   2.3.14
Action Mailer version     2.3.14
Active Support version    2.3.14
Database adapter          mysql2
Database schema version   20120301153455

About your Redmine plugins
Environmnet CSS   0.1

Additional Information:

  • your database manager version: MySQL 5.1.61
  • your Redmine version: 1.4.1

Problem:
When using the REST API to create or modify time_entries, custom_fields are ignored if using XML format. When I use JSON, it succeeds (but only if using some different structure than the one described on the WIKI page http://www.redmine.org/projects/redmine/wiki/Rest_api )

I tried all of the following XML structures:

  • The one described on the WIKI page:
    
    changed via XML PUT - 1
    
    
      1131
    
    
    
    
  • But also all of the following (the last one is no valid XML but I tried it anyway)
    
    changed via XML PUT - 2
    
    1132
    
    


changed via XML PUT - 3

1133


changed via XML PUT - 4

<4>1134


If I use JSON it succeeds with the following format:

{"time_entry":
  {
    "comments":"changed via JSON PUT - 2",
    "custom_field_values":
      {
        "4":"13:02"
      }
  }
}

  • If using the suggested format from the WIKI page, it does not work:
    {"time_entry":
    {
    "comments":"changed via JSON PUT - 1",
    "custom_fields":
      [
        {"value":"13:01","id":4}
      ]
    }
    }
    

Very interesting is, that XML POST/PUT with the documented format (WIKI page) works for issues!
So this succeeds:


  changed via XML PUT
  
    
      0
    
  


journals

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

--------------------------------------------------------------------------------
Fixed in r9783.
--------------------------------------------------------------------------------
Merged in 1.4-stable and 2.0-stable.
--------------------------------------------------------------------------------

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

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

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

いいね!0
いいね!0