Redmine: Issueshttps://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292011-06-27T19:55:33ZRedmine
Redmine Redmine - Defect #8698 (Closed): Issues REST-API not using valid XML anymore for XML node <custom...https://www.redmine.org/issues/86982011-06-27T19:55:33ZMichael Pfannkuchen
<p>I'm using REST API for importing issues into Redmine.<br />Used Framework is PHP/ActiveResource.php - this worked fine with Redmine 1.1.2.<br />With Redmine 1.2.0 the API changed , so that non-valid XML is necessary to create/update issues now. As far as I see only the POST and PUT requests changed, the GET requests (eg. <a class="external" href="http://www.example.com/issues/18.xml">http://www.example.com/issues/18.xml</a> ) still working the way before.</p>
<p>This REST-API Update sample worked with Redmine 1.1.2 (written as curl code):<br /><code>echo '<?xml version="1.0" encoding="ISO-8859-1" ?><issue><project_id>9</project_id><custom_fields><custom_field><id>2</id><name>reporter</name><value>my.collegue@example.com</value></custom_field></custom_fields></issue>' | curl --insecure -X PUT -H 'Content-type: text/xml' -H 'Accept: text/xml' -d @- https://www.example.com/issues/18.xml?format=xml\&key=12356454654</code></p>
<p>To get the same Update action done you have now (with Redmine 1.2.0) to write : <br /><code>echo '<?xml version="1.0" encoding="ISO-8859-1" ?><issue><project_id>9</project_id><custom_field_values><2>my.collegue@example.com</2></custom_field_values></issue>' | curl --insecure -X PUT -H 'Content-type: text/xml' -H 'Accept: text/xml' -d @- https://www.example.com/issues/18.xml?format=xml\&key=12356454654</code><br />The second syntax is not XML-valid and not possible to work out with PHP/ActiveResource.php</p>
<p>Ruby version 1.8.7 (x86_64-linux)<br />RubyGems version 1.6.2<br />Rack version 1.1.2<br />Rails version 2.3.11<br />Active Record version 2.3.11<br />Active Resource version 2.3.11<br />Action Mailer version 2.3.11<br />Active Support version 2.3.11<br />Edge Rails revision unknown<br />Application root /home/srv/www/redmine-1.2.0<br />Environment production<br />Database adapter mysql<br />Database schema version 20110511000000</p>