プロジェクト

全般

プロフィール

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

Mitsuyoshi Yoshida, 2011/12/11 18:30

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