プロジェクト

全般

プロフィール

Rest Issues » 履歴 » バージョン 4

Mitsuyoshi Yoshida, 2011/11/15 23: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 4 Mitsuyoshi Yoshida
  (カスタムフィールドの設定で [ *フィルタとして使う* ] にチェックが入っている必要があります。) !cf_settings.png!
32 1 Mitsuyoshi Yoshida
* ...
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 3 Mitsuyoshi Yoshida
id で指定したチケット情報を取得します。
97
98 1 Mitsuyoshi Yoshida
+パラメーター+:
99
100
* @include@: 以下の値が使用可能です。
101
** children (子チケット)
102
** attachments (添付ファイル)
103
** relations (関連するチケット)
104
** changesets (リポジトリのチェンジセット)
105
** journals (履歴)
106
107
108
+XML を使用+:
109
110
<pre>
111
GET /issues/[id].xml
112
</pre>
113
114
115
+JSON を使用+:
116
117
<pre>
118
GET /issues/[id].json
119
</pre>
120
121
122
h2. 作成
123
124 3 Mitsuyoshi Yoshida
XML または JSON で定義したチケットを作成します。
125
126 1 Mitsuyoshi Yoshida
+使用可能な要素+:
127 2 Mitsuyoshi Yoshida
128 1 Mitsuyoshi Yoshida
* subject (題名)
129
* project_id (プロジェクト)
130
* priority_id (優先度)
131
* description (説明)
132
* category_id (カテゴリ)
133
* assigned_to_id (担当者)
134
  指定した ID のユーザーをチケットの担当者にします。(現状ではユーザー名での指定は出来ません)
135
* status_id (ステータス)
136
* ...
137
138
139
+XML を使用+:
140
141
<pre>
142
  POST /issues.xml
143
</pre><pre><code class="xml">
144
  <?xml version="1.0"?>
145
  <issue>
146
    <subject>Example</subject>
147
    <project_id>1</project_id>
148
    <priority_id>4</priority_id>
149
  </issue>
150
</code></pre>
151
152
153
154
+JSON を使用+:
155
156
<pre>POST /issues.json</pre><pre><code class="json">
157
{
158
    "issue": {
159
      "project_id": "example",
160
      "subject": "Test issue",
161
      "custom_field_values":{
162
                              "1":"1.1.3"  #the affected version field
163
      }
164
    }
165
}
166
</code></pre>
167
168
169
h2. 更新
170
171 3 Mitsuyoshi Yoshida
id で指定したチケットに対して XML または JSON で定義した情報で更新します。
172
173 1 Mitsuyoshi Yoshida
+XML を使用+:
174
175
  PUT /issues/[id].xml
176
177
178
+JSON を使用+:
179
180
<pre>PUT /issues/[id].json</pre><pre><code class="json">
181
{
182
    "issue": {
183
      "subject": "Example issue (was: Test issue)",
184
      "notes": "Changing the subject"
185
    }
186
}</code></pre>
187
188
189
h2. 削除
190 3 Mitsuyoshi Yoshida
191
id で指定したチケットを削除します。
192 1 Mitsuyoshi Yoshida
193
  DELETE /issues/[id].xml
194