Project

General

Profile

Rest IssueJournals » History » Revision 2

Revision 1 (Emmanuel Bourgerie, 2011-12-07 11:36) → Revision 2/4 (Charles Goyard, 2018-01-15 23:38)

h1. Rest Issue journals 

 {{>toc}} 

 h2. Including journals in issue display 

 As usual, can be done via XML or JSON. Responses examples are provided for XML. 

 <pre> 
 GET /issues/[id].xml?include=journals 
 GET /issues/[id].json?include=journals 
 </pre> 

 +Response+ 
 <pre> 
 <issue> 
     <id>1</id> 
     <project name="Redmine" id="1"/> 
     <tracker name="Defect" id="1"/> 
	
	 [...] 
	
	 <journals type="array"> 
		 <journal id="1"> 
			 <user name="Jean-Philippe Lang" id="1"/> 
			 <notes>Fixed in Revision 128</notes> 
			 <created_on>2007-01-01T05:21:00+01:00</created_on> 
			 <details type="array"/> 
		 </journal> 

		 [...] 
		
		 <journal id="10531"> 
			 <user name="efgh efgh" id="7384"/> 
			 <notes/> 
			 <created_on>2009-08-13T11:33:17+02:00</created_on> 
			 <details type="array"> 
				 <detail property="attr" name="status_id"> 
					 <old_value>5</old_value> 
					 <new_value>8</new_value> 
				 </detail> 
			 </details> 
		 </journal> 
		
		 [...] 
		
	 </journals> 
 </issue> 
 </pre> 
 This example shows two common journal entries : one with a note (=a comment) and the other with a property value. 

 h2. Updating an issue 

 h3. Adding a note 

 To add a note to the journal entries, you can update the issue with data consisting of only a note. 

 +Examples:+ 

 <pre> (soon) 
 PUT /issues/[id].xml 
 <issue> 
     <notes> 
         Fixed in Revision 128 
     </notes> 
 </issue> 
 </pre> 
 <pre> 
 PUT /issues/[id].json 
 { 
     "issue": { 
         "notes": "Fixed in Revision 128" 
     } 
 } 
 </pre>