Rest Issues » History » Version 15

Ian Epperson, 2010-10-21 05:36

1 1 Jean-Philippe Lang
h1. Issues
2 1 Jean-Philippe Lang
3 1 Jean-Philippe Lang
h2. Listing issues
4 1 Jean-Philippe Lang
5 1 Jean-Philippe Lang
  GET /issues.xml
6 1 Jean-Philippe Lang
7 2 Jean-Philippe Lang
Returns a paginated list of issues. By default, it returns open issues only.
8 1 Jean-Philippe Lang
9 1 Jean-Philippe Lang
+Parameters+:
10 1 Jean-Philippe Lang
11 1 Jean-Philippe Lang
* @page@: page number (optional)
12 2 Jean-Philippe Lang
13 2 Jean-Philippe Lang
Optional filters:
14 2 Jean-Philippe Lang
15 2 Jean-Philippe Lang
* @project_id@: get issues from the project with the given id
16 2 Jean-Philippe Lang
* @tracker_id@: get issues from the tracker with the given id
17 2 Jean-Philippe Lang
* @status_id@: get issues with the given status id only (you can use @*@ to get open and closed issues)
18 2 Jean-Philippe Lang
* ...
19 2 Jean-Philippe Lang
20 2 Jean-Philippe Lang
+Examples+:
21 2 Jean-Philippe Lang
22 2 Jean-Philippe Lang
<pre>
23 2 Jean-Philippe Lang
GET /issues.xml
24 2 Jean-Philippe Lang
GET /issues.xml?project_id=2
25 2 Jean-Philippe Lang
GET /issues.xml?project_id=2&tracker_id=1
26 12 Robert Palmer
GET /issues.xml?assigned_to=me
27 12 Robert Palmer
GET /issues.xml?status_id=closed
28 12 Robert Palmer
GET /issues.xml?status_id=*
29 2 Jean-Philippe Lang
</pre>
30 12 Robert Palmer
31 12 Robert Palmer
32 1 Jean-Philippe Lang
33 1 Jean-Philippe Lang
+Response+:
34 1 Jean-Philippe Lang
35 1 Jean-Philippe Lang
<pre>
36 1 Jean-Philippe Lang
<?xml version="1.0" encoding="UTF-8"?>
37 1 Jean-Philippe Lang
<issues type="array" count="1640">
38 3 Christoph Witzany
  <issue>
39 3 Christoph Witzany
    <id>4326</id>
40 1 Jean-Philippe Lang
    <project name="Redmine" id="1"/>
41 1 Jean-Philippe Lang
    <tracker name="Feature" id="2"/>
42 1 Jean-Philippe Lang
    <status name="New" id="1"/>
43 1 Jean-Philippe Lang
    <priority name="Normal" id="4"/>
44 1 Jean-Philippe Lang
    <author name="John Smith" id="10106"/>
45 1 Jean-Philippe Lang
    <category name="Email notifications" id="9"/>
46 1 Jean-Philippe Lang
    <subject>
47 1 Jean-Philippe Lang
      Aggregate Multiple Issue Changes for Email Notifications
48 1 Jean-Philippe Lang
    </subject>
49 1 Jean-Philippe Lang
    <description>
50 1 Jean-Philippe Lang
      This is not to be confused with another useful proposed feature that
51 1 Jean-Philippe Lang
      would do digest emails for notifications.
52 1 Jean-Philippe Lang
    </description>
53 1 Jean-Philippe Lang
    <start_date>2009-12-03</start_date>
54 1 Jean-Philippe Lang
    <due_date></due_date>
55 1 Jean-Philippe Lang
    <done_ratio>0</done_ratio>
56 1 Jean-Philippe Lang
    <estimated_hours></estimated_hours>
57 1 Jean-Philippe Lang
    <custom_fields>
58 1 Jean-Philippe Lang
      <custom_field name="Resolution" id="2">Duplicate</custom_field>
59 1 Jean-Philippe Lang
      <custom_field name="Texte" id="5">Test</custom_field>
60 1 Jean-Philippe Lang
      <custom_field name="Boolean" id="6">1</custom_field>
61 1 Jean-Philippe Lang
      <custom_field name="Date" id="7">2010-01-12</custom_field>
62 1 Jean-Philippe Lang
    </custom_fields>
63 1 Jean-Philippe Lang
    <created_on>Thu Dec 03 15:02:12 +0100 2009</created_on>
64 1 Jean-Philippe Lang
    <updated_on>Sun Jan 03 12:08:41 +0100 2010</updated_on>
65 1 Jean-Philippe Lang
  </issue>
66 3 Christoph Witzany
  <issue>
67 3 Christoph Witzany
    <id>4325</id>
68 1 Jean-Philippe Lang
    ...
69 1 Jean-Philippe Lang
  </issue>
70 1 Jean-Philippe Lang
</issues>
71 1 Jean-Philippe Lang
</pre>
72 1 Jean-Philippe Lang
73 1 Jean-Philippe Lang
h2. Showing an issue
74 1 Jean-Philippe Lang
75 1 Jean-Philippe Lang
  GET /issues/[id].xml
76 1 Jean-Philippe Lang
77 1 Jean-Philippe Lang
h2. Creating an issue
78 1 Jean-Philippe Lang
79 5 Damien Churchill
h3. Using XML
80 5 Damien Churchill
81 1 Jean-Philippe Lang
<pre>
82 10 Robert Palmer
  POST /issues.xml
83 1 Jean-Philippe Lang
  <?xml version="1.0"?>
84 9 Robert Palmer
  <issue>
85 9 Robert Palmer
    <subject>Example</subject>
86 11 Robert Palmer
    <project_id>1</project_id>
87 9 Robert Palmer
    <priority_id>4</priority_id>
88 9 Robert Palmer
  </issue>
89 9 Robert Palmer
</pre>
90 7 Robert Palmer
91 15 Ian Epperson
Other available tags (incomplete list):
92 15 Ian Epperson
* description
93 15 Ian Epperson
* category_id
94 15 Ian Epperson
* assigned_to_id - ID of the user to assign the issue to (currently no mechanism to assign by name)
95 1 Jean-Philippe Lang
96 5 Damien Churchill
97 5 Damien Churchill
h3. Using JSON
98 5 Damien Churchill
99 5 Damien Churchill
  POST /issues.json
100 5 Damien Churchill
  {
101 5 Damien Churchill
    "issue": {
102 5 Damien Churchill
      "project_id": "example",
103 5 Damien Churchill
      "subject": "Test issue"
104 5 Damien Churchill
    }
105 5 Damien Churchill
}
106 5 Damien Churchill
107 1 Jean-Philippe Lang
108 1 Jean-Philippe Lang
h2. Updating an issue
109 5 Damien Churchill
110 5 Damien Churchill
h3. Using XML
111 1 Jean-Philippe Lang
112 5 Damien Churchill
  PUT /issues/[id].xml
113 5 Damien Churchill
114 5 Damien Churchill
h3. Using JSON
115 6 Robert Palmer
116 5 Damien Churchill
  PUT /issues/[id].json
117 5 Damien Churchill
  {
118 5 Damien Churchill
    "issue": {
119 5 Damien Churchill
      "subject": "Example issue (was: Test issue)"
120 5 Damien Churchill
    },
121 5 Damien Churchill
    "notes": "Changing the subject"
122 5 Damien Churchill
}
123 1 Jean-Philippe Lang
124 1 Jean-Philippe Lang
125 1 Jean-Philippe Lang
h2. Deleting an issue
126 1 Jean-Philippe Lang
127 4 Ryan Lovelett
  DELETE /issues/[id].xml
128 4 Ryan Lovelett
129 4 Ryan Lovelett
h2. Authentication
130 4 Ryan Lovelett
131 14 Ian Epperson
To interact with issues that are not open to the public you _must_ use your API key or username/password.   The API key is a handy way to avoid putting a password in a script.  You can find your API key on the My account page ( /my/account ) when logged in, on the right-hand pane of the default layout.  The API key may be attached to the GET request as a "key" parameter or it may be passed in as a username with a random password.  (Note that at the time of this writing, the "key" parameter will not be able to retrieve a specific issue.)
132 4 Ryan Lovelett
133 4 Ryan Lovelett
+Examples _(not real keys)_+:
134 4 Ryan Lovelett
135 4 Ryan Lovelett
<pre>
136 4 Ryan Lovelett
GET /issues.xml?key=1a022b4661da64e5dca53ebab0c94ad7
137 4 Ryan Lovelett
GET /issues.xml?project_id=2&key=1a022b4661da64e5dca53ebab0c94ad7
138 4 Ryan Lovelett
GET /issues.xml?project_id=2&tracker_id=1&key=1a022b4661da64e5dca53ebab0c94ad7
139 1 Jean-Philippe Lang
</pre>