Rest IssueJournals » History » Version 2

Charles Goyard, 2018-01-15 23:38

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 1 Emmanuel Bourgerie
<pre>
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 1 Emmanuel Bourgerie
</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 2 Charles Goyard
<pre>
61 2 Charles Goyard
PUT /issues/[id].xml
62 2 Charles Goyard
<issue>
63 2 Charles Goyard
    <notes>
64 2 Charles Goyard
        Fixed in Revision 128
65 2 Charles Goyard
    </notes>
66 2 Charles Goyard
</issue>
67 2 Charles Goyard
</pre>
68 2 Charles Goyard
<pre>
69 2 Charles Goyard
PUT /issues/[id].json
70 2 Charles Goyard
{
71 2 Charles Goyard
    "issue": {
72 2 Charles Goyard
        "notes": "Fixed in Revision 128"
73 2 Charles Goyard
    }
74 2 Charles Goyard
}
75 2 Charles Goyard
</pre>