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