プロジェクト

全般

プロフィール

Rest Issues » 履歴 » リビジョン 2

リビジョン 1 (Mitsuyoshi Yoshida, 2011/11/13 12:16) → リビジョン 2/7 (Mitsuyoshi Yoshida, 2011/11/13 12:29)

redmine.org の "Rest_Issues":http://www.redmine.org/projects/redmine/wiki/Rest_Issues の日本語訳です。 

 {{>toc}} 

 h1. REST チケット 

 h2. 一覧 

 <pre>GET /issues.xml</pre> 

 チケットの一覧を取得します。レスポンスはページ割りされたチケットのリストで、デフォルトでは未完了のチケットのみ対象となります。 ページ割りされたチケットの一覧が帰ってきます。デフォルトでは未完了のチケットのみ対象となります。 

 +パラメーター+: 

 共通パラメーター: 

 * @offset@ 
 * @limit@ 
 * @page@ 

 フィルターオプション: 

 * @project_id@: 指定したプロジェクトのチケットだけを取得します。 プロジェクトの指定は ID または 識別子で行います。  
 * @tracker_id@: ID でトラッカーを指定します。 
 * @status_id@: チケットのステータスを指定します。以下の値だけ使用可能です。 
 ** @open@ (未完了) 
 ** @closed@ (完了) 
 ** @*@ (すべて) 
 * @assigned_to_id@: 指定したユーザーが担当者になっているチケットだけ取得します。ユーザー ID で指定します。 
 * @cf_x@: カスタムフィールドの値が指定した値と一致するチケットだけを取得します。 @x@ は対象となるカスタムフィールドの ID です。 
   (カスタムフィールドの設定で 'フィルタとして使う' にチェックが入っている必要があります。) 
 * ... 


 +例+: 

 <pre> 
 GET /issues.xml 
 GET /issues.xml?project_id=2 
 GET /issues.xml?project_id=2&tracker_id=1 
 GET /issues.xml?assigned_to_id=6 
 GET /issues.xml?status_id=closed 
 GET /issues.xml?status_id=* 
 GET /issues.xml?cf_1=abcdef 

 ページ割りの例: 
 GET /issues.xml?project_id=testproject&query_id=2&offset=0&limit=100 
 GET /issues.xml?project_id=testproject&query_id=2&offset=50&limit=100 
 </pre> 



 +レスポンス+: 

 <pre><code class="xml"> 
 <?xml version="1.0" encoding="UTF-8"?> 
 <issues type="array" count="1640"> 
   <issue> 
     <id>4326</id> 
     <project name="Redmine" id="1"/> 
     <tracker name="Feature" id="2"/> 
     <status name="New" id="1"/> 
     <priority name="Normal" id="4"/> 
     <author name="John Smith" id="10106"/> 
     <category name="Email notifications" id="9"/> 
     <subject> 
       Aggregate Multiple Issue Changes for Email Notifications 
     </subject> 
     <description> 
       This is not to be confused with another useful proposed feature that 
       would do digest emails for notifications. 
     </description> 
     <start_date>2009-12-03</start_date> 
     <due_date></due_date> 
     <done_ratio>0</done_ratio> 
     <estimated_hours></estimated_hours> 
     <custom_fields> 
       <custom_field name="Resolution" id="2">Duplicate</custom_field> 
       <custom_field name="Texte" id="5">Test</custom_field> 
       <custom_field name="Boolean" id="6">1</custom_field> 
       <custom_field name="Date" id="7">2010-01-12</custom_field> 
     </custom_fields> 
     <created_on>Thu Dec 03 15:02:12 +0100 2009</created_on> 
     <updated_on>Sun Jan 03 12:08:41 +0100 2010</updated_on> 
   </issue> 
   <issue> 
     <id>4325</id> 
     ... 
   </issue> 
 </issues> 
 </code></pre> 


 h2. 表示 

 +パラメーター+: 

 * @include@: 以下の値が使用可能です。 
 ** children (子チケット) 
 ** attachments (添付ファイル) 
 ** relations (関連するチケット) 
 ** changesets (リポジトリのチェンジセット) 
 ** journals (履歴) 


 +XML を使用+: 

 <pre> 
 GET /issues/[id].xml 
 </pre> 


 +JSON を使用+: 

 <pre> 
 GET /issues/[id].json 
 </pre> 


 h2. 作成 

 +使用可能な要素+: 

 
 * subject (題名) 
 * project_id (プロジェクト) 
 * priority_id (優先度) 
 * description (説明) 
 * category_id (カテゴリ) 
 * assigned_to_id (担当者) 
   指定した ID のユーザーをチケットの担当者にします。(現状ではユーザー名での指定は出来ません) 
 * status_id (ステータス) 
 * ... 


 +XML を使用+: 

 <pre> 
   POST /issues.xml 
 </pre><pre><code class="xml"> 
   <?xml version="1.0"?> 
   <issue> 
     <subject>Example</subject> 
     <project_id>1</project_id> 
     <priority_id>4</priority_id> 
   </issue> 
 </code></pre> 



 +JSON を使用+: 

 <pre>POST /issues.json</pre><pre><code class="json"> 
 { 
     "issue": { 
       "project_id": "example", 
       "subject": "Test issue", 
       "custom_field_values":{ 
                               "1":"1.1.3"    #the affected version field 
       } 
     } 
 } 
 </code></pre> 


 h2. 更新 

 +XML を使用+: 

   PUT /issues/[id].xml 


 +JSON を使用+: 

 <pre>PUT /issues/[id].json</pre><pre><code class="json"> 
 { 
     "issue": { 
       "subject": "Example issue (was: Test issue)", 
       "notes": "Changing the subject" 
     } 
 }</code></pre> 


 h2. 削除 

   DELETE /issues/[id].xml