Rest IssueRelations » History » Version 2

Jean-Philippe Lang, 2011-07-04 19:49

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