Rest Issues » 履歴 » バージョン 2
Mitsuyoshi Yoshida, 2011/11/13 12:29
1 | 1 | Mitsuyoshi Yoshida | redmine.org の "Rest_Issues":http://www.redmine.org/projects/redmine/wiki/Rest_Issues の日本語訳です。 |
---|---|---|---|
2 | |||
3 | {{>toc}} |
||
4 | |||
5 | h1. REST チケット |
||
6 | |||
7 | h2. 一覧 |
||
8 | |||
9 | <pre>GET /issues.xml</pre> |
||
10 | |||
11 | 2 | Mitsuyoshi Yoshida | チケットの一覧を取得します。レスポンスはページ割りされたチケットのリストで、デフォルトでは未完了のチケットのみ対象となります。 |
12 | 1 | Mitsuyoshi Yoshida | |
13 | +パラメーター+: |
||
14 | |||
15 | 共通パラメーター: |
||
16 | |||
17 | * @offset@ |
||
18 | * @limit@ |
||
19 | * @page@ |
||
20 | |||
21 | フィルターオプション: |
||
22 | |||
23 | * @project_id@: 指定したプロジェクトのチケットだけを取得します。 プロジェクトの指定は ID または 識別子で行います。 |
||
24 | * @tracker_id@: ID でトラッカーを指定します。 |
||
25 | * @status_id@: チケットのステータスを指定します。以下の値だけ使用可能です。 |
||
26 | ** @open@ (未完了) |
||
27 | ** @closed@ (完了) |
||
28 | ** @*@ (すべて) |
||
29 | * @assigned_to_id@: 指定したユーザーが担当者になっているチケットだけ取得します。ユーザー ID で指定します。 |
||
30 | * @cf_x@: カスタムフィールドの値が指定した値と一致するチケットだけを取得します。 @x@ は対象となるカスタムフィールドの ID です。 |
||
31 | (カスタムフィールドの設定で 'フィルタとして使う' にチェックが入っている必要があります。) |
||
32 | * ... |
||
33 | |||
34 | |||
35 | +例+: |
||
36 | |||
37 | <pre> |
||
38 | GET /issues.xml |
||
39 | GET /issues.xml?project_id=2 |
||
40 | GET /issues.xml?project_id=2&tracker_id=1 |
||
41 | GET /issues.xml?assigned_to_id=6 |
||
42 | GET /issues.xml?status_id=closed |
||
43 | GET /issues.xml?status_id=* |
||
44 | GET /issues.xml?cf_1=abcdef |
||
45 | |||
46 | ページ割りの例: |
||
47 | GET /issues.xml?project_id=testproject&query_id=2&offset=0&limit=100 |
||
48 | GET /issues.xml?project_id=testproject&query_id=2&offset=50&limit=100 |
||
49 | </pre> |
||
50 | |||
51 | |||
52 | |||
53 | +レスポンス+: |
||
54 | |||
55 | <pre><code class="xml"> |
||
56 | <?xml version="1.0" encoding="UTF-8"?> |
||
57 | <issues type="array" count="1640"> |
||
58 | <issue> |
||
59 | <id>4326</id> |
||
60 | <project name="Redmine" id="1"/> |
||
61 | <tracker name="Feature" id="2"/> |
||
62 | <status name="New" id="1"/> |
||
63 | <priority name="Normal" id="4"/> |
||
64 | <author name="John Smith" id="10106"/> |
||
65 | <category name="Email notifications" id="9"/> |
||
66 | <subject> |
||
67 | Aggregate Multiple Issue Changes for Email Notifications |
||
68 | </subject> |
||
69 | <description> |
||
70 | This is not to be confused with another useful proposed feature that |
||
71 | would do digest emails for notifications. |
||
72 | </description> |
||
73 | <start_date>2009-12-03</start_date> |
||
74 | <due_date></due_date> |
||
75 | <done_ratio>0</done_ratio> |
||
76 | <estimated_hours></estimated_hours> |
||
77 | <custom_fields> |
||
78 | <custom_field name="Resolution" id="2">Duplicate</custom_field> |
||
79 | <custom_field name="Texte" id="5">Test</custom_field> |
||
80 | <custom_field name="Boolean" id="6">1</custom_field> |
||
81 | <custom_field name="Date" id="7">2010-01-12</custom_field> |
||
82 | </custom_fields> |
||
83 | <created_on>Thu Dec 03 15:02:12 +0100 2009</created_on> |
||
84 | <updated_on>Sun Jan 03 12:08:41 +0100 2010</updated_on> |
||
85 | </issue> |
||
86 | <issue> |
||
87 | <id>4325</id> |
||
88 | ... |
||
89 | </issue> |
||
90 | </issues> |
||
91 | </code></pre> |
||
92 | |||
93 | |||
94 | h2. 表示 |
||
95 | |||
96 | +パラメーター+: |
||
97 | |||
98 | * @include@: 以下の値が使用可能です。 |
||
99 | ** children (子チケット) |
||
100 | ** attachments (添付ファイル) |
||
101 | ** relations (関連するチケット) |
||
102 | ** changesets (リポジトリのチェンジセット) |
||
103 | ** journals (履歴) |
||
104 | |||
105 | |||
106 | +XML を使用+: |
||
107 | |||
108 | <pre> |
||
109 | GET /issues/[id].xml |
||
110 | </pre> |
||
111 | |||
112 | |||
113 | +JSON を使用+: |
||
114 | |||
115 | <pre> |
||
116 | GET /issues/[id].json |
||
117 | </pre> |
||
118 | |||
119 | |||
120 | h2. 作成 |
||
121 | |||
122 | +使用可能な要素+: |
||
123 | 2 | Mitsuyoshi Yoshida | |
124 | 1 | Mitsuyoshi Yoshida | * subject (題名) |
125 | * project_id (プロジェクト) |
||
126 | * priority_id (優先度) |
||
127 | * description (説明) |
||
128 | * category_id (カテゴリ) |
||
129 | * assigned_to_id (担当者) |
||
130 | 指定した ID のユーザーをチケットの担当者にします。(現状ではユーザー名での指定は出来ません) |
||
131 | * status_id (ステータス) |
||
132 | * ... |
||
133 | |||
134 | |||
135 | +XML を使用+: |
||
136 | |||
137 | <pre> |
||
138 | POST /issues.xml |
||
139 | </pre><pre><code class="xml"> |
||
140 | <?xml version="1.0"?> |
||
141 | <issue> |
||
142 | <subject>Example</subject> |
||
143 | <project_id>1</project_id> |
||
144 | <priority_id>4</priority_id> |
||
145 | </issue> |
||
146 | </code></pre> |
||
147 | |||
148 | |||
149 | |||
150 | +JSON を使用+: |
||
151 | |||
152 | <pre>POST /issues.json</pre><pre><code class="json"> |
||
153 | { |
||
154 | "issue": { |
||
155 | "project_id": "example", |
||
156 | "subject": "Test issue", |
||
157 | "custom_field_values":{ |
||
158 | "1":"1.1.3" #the affected version field |
||
159 | } |
||
160 | } |
||
161 | } |
||
162 | </code></pre> |
||
163 | |||
164 | |||
165 | h2. 更新 |
||
166 | |||
167 | +XML を使用+: |
||
168 | |||
169 | PUT /issues/[id].xml |
||
170 | |||
171 | |||
172 | +JSON を使用+: |
||
173 | |||
174 | <pre>PUT /issues/[id].json</pre><pre><code class="json"> |
||
175 | { |
||
176 | "issue": { |
||
177 | "subject": "Example issue (was: Test issue)", |
||
178 | "notes": "Changing the subject" |
||
179 | } |
||
180 | }</code></pre> |
||
181 | |||
182 | |||
183 | h2. 削除 |
||
184 | |||
185 | DELETE /issues/[id].xml |
||
186 |