Rest IssueRelations » History » Version 3
Jean-Philippe Lang, 2011-07-05 18:48
shallow resource
1 | 1 | Jean-Philippe Lang | h1. Issue Relations |
---|---|---|---|
2 | |||
3 | {{>toc}} |
||
4 | |||
5 | 2 | Jean-Philippe Lang | h2. /issues/:issue_id/relations.:format |
6 | 1 | Jean-Philippe Lang | |
7 | 2 | Jean-Philippe Lang | h3. GET |
8 | |||
9 | Returns the relations for the issue of given id (:issue_id). |
||
10 | |||
11 | +Example+: |
||
12 | |||
13 | <pre> |
||
14 | GET /issues/8470/relations.xml |
||
15 | </pre> |
||
16 | |||
17 | +Response+: |
||
18 | |||
19 | <pre> |
||
20 | <?xml version="1.0" encoding="UTF-8"?> |
||
21 | <relations type="array"> |
||
22 | <relation> |
||
23 | <id>1819</id> |
||
24 | <issue_id>8470</issue_id> |
||
25 | <issue_to_id>8469</issue_to_id> |
||
26 | <relation_type>relates</relation_type> |
||
27 | <delay/> |
||
28 | </relation> |
||
29 | <relation> |
||
30 | <id>1820</id> |
||
31 | <issue_id>8470</issue_id> |
||
32 | <issue_to_id>8467</issue_to_id> |
||
33 | <relation_type>relates</relation_type> |
||
34 | <delay/> |
||
35 | </relation> |
||
36 | </relations> |
||
37 | </pre> |
||
38 | |||
39 | Note: when getting an issue, relations can also be retrieved in a single request using @/issues/:id.:format?include=relations@. |
||
40 | |||
41 | 1 | Jean-Philippe Lang | h3. POST |
42 | |||
43 | Creates a relation for the issue of given id (:issue_id). |
||
44 | |||
45 | +Parameters+: |
||
46 | |||
47 | * @relation@ (required): a hash of the relation attributes, including: |
||
48 | |||
49 | * @issue_to_id@ (required): the id of the related issue |
||
50 | * @relation_type@ (required): the type of relation (in: "relates", "duplicates", "duplicated", "blocks", "blocked", "precedes", "follows") |
||
51 | * @delay@ (optional): the delay for a "precedes" or "follows" relation |
||
52 | |||
53 | +Response+: |
||
54 | |||
55 | * @201 Created@: relation was created |
||
56 | * @422 Unprocessable Entity@: relation was not created due to validation failures (response body contains the error messages) |
||
57 | |||
58 | 3 | Jean-Philippe Lang | h2. /relations/:id.:format |
59 | 1 | Jean-Philippe Lang | |
60 | h3. GET |
||
61 | |||
62 | Returns the relation of given id. |
||
63 | 2 | Jean-Philippe Lang | |
64 | +Example+: |
||
65 | |||
66 | <pre> |
||
67 | 3 | Jean-Philippe Lang | GET /relations/1819.xml |
68 | 2 | Jean-Philippe Lang | </pre> |
69 | 1 | Jean-Philippe Lang | |
70 | +Response+: |
||
71 | |||
72 | <pre> |
||
73 | <?xml version="1.0" encoding="UTF-8"?> |
||
74 | <relation> |
||
75 | <id>1819</id> |
||
76 | <issue_id>8470</issue_id> |
||
77 | <issue_to_id>8469</issue_to_id> |
||
78 | <relation_type>relates</relation_type> |
||
79 | <delay/> |
||
80 | </relation> |
||
81 | </pre> |
||
82 | |||
83 | h3. DELETE |
||
84 | |||
85 | Deletes the relation of given id. |
||
86 | |||
87 | +Response+: |
||
88 | |||
89 | * @200 OK@: relation was deleted |
||
90 | * @422 Unprocessable Entity@: relation was not deleted (response body contains the error messages) |