プロジェクト

全般

プロフィール

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

Mitsuyoshi Yoshida, 2011/11/13 12:16

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
ページ割りされたチケットの一覧が帰ってきます。デフォルトでは未完了のチケットのみ対象となります。
12
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
* subject (題名)
124
* project_id (プロジェクト)
125
* priority_id (優先度)
126
* description (説明)
127
* category_id (カテゴリ)
128
* assigned_to_id (担当者)
129
  指定した ID のユーザーをチケットの担当者にします。(現状ではユーザー名での指定は出来ません)
130
* status_id (ステータス)
131
* ...
132
133
134
+XML を使用+:
135
136
<pre>
137
  POST /issues.xml
138
</pre><pre><code class="xml">
139
  <?xml version="1.0"?>
140
  <issue>
141
    <subject>Example</subject>
142
    <project_id>1</project_id>
143
    <priority_id>4</priority_id>
144
  </issue>
145
</code></pre>
146
147
148
149
+JSON を使用+:
150
151
<pre>POST /issues.json</pre><pre><code class="json">
152
{
153
    "issue": {
154
      "project_id": "example",
155
      "subject": "Test issue",
156
      "custom_field_values":{
157
                              "1":"1.1.3"  #the affected version field
158
      }
159
    }
160
}
161
</code></pre>
162
163
164
h2. 更新
165
166
+XML を使用+:
167
168
  PUT /issues/[id].xml
169
170
171
+JSON を使用+:
172
173
<pre>PUT /issues/[id].json</pre><pre><code class="json">
174
{
175
    "issue": {
176
      "subject": "Example issue (was: Test issue)",
177
      "notes": "Changing the subject"
178
    }
179
}</code></pre>
180
181
182
h2. 削除
183
184
  DELETE /issues/[id].xml
185