Project

General

Profile

Actions

Defect #8698

closed

Issues REST-API not using valid XML anymore for XML node <custom_field_values/>

Added by Michael Pfannkuchen almost 13 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
2011-06-27
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

I'm using REST API for importing issues into Redmine.
Used Framework is PHP/ActiveResource.php - this worked fine with Redmine 1.1.2.
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. http://www.example.com/issues/18.xml ) still working the way before.

This REST-API Update sample worked with Redmine 1.1.2 (written as curl 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

To get the same Update action done you have now (with Redmine 1.2.0) to write :
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
The second syntax is not XML-valid and not possible to work out with PHP/ActiveResource.php

Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.6.2
Rack version 1.1.2
Rails version 2.3.11
Active Record version 2.3.11
Active Resource version 2.3.11
Action Mailer version 2.3.11
Active Support version 2.3.11
Edge Rails revision unknown
Application root /home/srv/www/redmine-1.2.0
Environment production
Database adapter mysql
Database schema version 20110511000000

Actions

Also available in: Atom PDF