Project

General

Profile

Rest IssueJournals » History » Version 4

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

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