Rest IssueJournals » History » Version 4

Toshi MARUYAMA, 2018-01-16 11:19
use code highlight

1 1 Emmanuel Bourgerie
h1. Rest Issue journals
2 1 Emmanuel Bourgerie
3 1 Emmanuel Bourgerie
{{>toc}}
4 1 Emmanuel Bourgerie
5 1 Emmanuel Bourgerie
h2. Including journals in issue display
6 1 Emmanuel Bourgerie
7 1 Emmanuel Bourgerie
As usual, can be done via XML or JSON. Responses examples are provided for XML.
8 1 Emmanuel Bourgerie
9 1 Emmanuel Bourgerie
<pre>
10 1 Emmanuel Bourgerie
GET /issues/[id].xml?include=journals
11 1 Emmanuel Bourgerie
GET /issues/[id].json?include=journals
12 1 Emmanuel Bourgerie
</pre>
13 1 Emmanuel Bourgerie
14 1 Emmanuel Bourgerie
+Response+
15 4 Toshi MARUYAMA
<pre><code class="xml">
16 1 Emmanuel Bourgerie
<issue>
17 1 Emmanuel Bourgerie
    <id>1</id>
18 1 Emmanuel Bourgerie
    <project name="Redmine" id="1"/>
19 1 Emmanuel Bourgerie
    <tracker name="Defect" id="1"/>
20 1 Emmanuel Bourgerie
	
21 1 Emmanuel Bourgerie
	[...]
22 1 Emmanuel Bourgerie
	
23 1 Emmanuel Bourgerie
	<journals type="array">
24 1 Emmanuel Bourgerie
		<journal id="1">
25 1 Emmanuel Bourgerie
			<user name="Jean-Philippe Lang" id="1"/>
26 1 Emmanuel Bourgerie
			<notes>Fixed in Revision 128</notes>
27 1 Emmanuel Bourgerie
			<created_on>2007-01-01T05:21:00+01:00</created_on>
28 1 Emmanuel Bourgerie
			<details type="array"/>
29 1 Emmanuel Bourgerie
		</journal>
30 1 Emmanuel Bourgerie
31 1 Emmanuel Bourgerie
		[...]
32 1 Emmanuel Bourgerie
		
33 1 Emmanuel Bourgerie
		<journal id="10531">
34 1 Emmanuel Bourgerie
			<user name="efgh efgh" id="7384"/>
35 1 Emmanuel Bourgerie
			<notes/>
36 1 Emmanuel Bourgerie
			<created_on>2009-08-13T11:33:17+02:00</created_on>
37 1 Emmanuel Bourgerie
			<details type="array">
38 1 Emmanuel Bourgerie
				<detail property="attr" name="status_id">
39 1 Emmanuel Bourgerie
					<old_value>5</old_value>
40 1 Emmanuel Bourgerie
					<new_value>8</new_value>
41 1 Emmanuel Bourgerie
				</detail>
42 1 Emmanuel Bourgerie
			</details>
43 1 Emmanuel Bourgerie
		</journal>
44 1 Emmanuel Bourgerie
		
45 1 Emmanuel Bourgerie
		[...]
46 1 Emmanuel Bourgerie
		
47 1 Emmanuel Bourgerie
	</journals>
48 1 Emmanuel Bourgerie
</issue>
49 4 Toshi MARUYAMA
</code></pre>
50 1 Emmanuel Bourgerie
This example shows two common journal entries : one with a note (=a comment) and the other with a property value.
51 1 Emmanuel Bourgerie
52 1 Emmanuel Bourgerie
h2. Updating an issue
53 1 Emmanuel Bourgerie
54 2 Charles Goyard
h3. Adding a note
55 2 Charles Goyard
56 2 Charles Goyard
To add a note to the journal entries, you can update the issue with data consisting of only a note.
57 2 Charles Goyard
58 2 Charles Goyard
+Examples:+
59 2 Charles Goyard
60 1 Emmanuel Bourgerie
<pre>
61 1 Emmanuel Bourgerie
PUT /issues/[id].xml
62 4 Toshi MARUYAMA
</pre>
63 4 Toshi MARUYAMA
64 4 Toshi MARUYAMA
<pre><code class="xml">
65 2 Charles Goyard
<issue>
66 2 Charles Goyard
    <notes>
67 1 Emmanuel Bourgerie
        Fixed in Revision 128
68 2 Charles Goyard
    </notes>
69 2 Charles Goyard
</issue>
70 4 Toshi MARUYAMA
</code></pre>
71 1 Emmanuel Bourgerie
<pre>
72 1 Emmanuel Bourgerie
PUT /issues/[id].json
73 4 Toshi MARUYAMA
</pre>
74 4 Toshi MARUYAMA
75 4 Toshi MARUYAMA
<pre><code class="json">
76 2 Charles Goyard
{
77 1 Emmanuel Bourgerie
    "issue": {
78 2 Charles Goyard
        "notes": "Fixed in Revision 128"
79 2 Charles Goyard
    }
80 2 Charles Goyard
}
81 4 Toshi MARUYAMA
</code></pre>