Defect #10013

Rest API - Create Version -> Internal server error 500

Added by Juraj Tomana almost 6 years ago. Updated almost 6 years ago.

Status:ClosedStart date:
Priority:UrgentDue date:
Assignee:-% Done:

0%

Category:REST API
Target version:1.3.1
Resolution:Fixed Affected version:1.3.0

Description

I'm trying to create new version in project using Rest API using C# code:

Uri address = new Uri("http://myredmineserver/projects/test/versions.xml?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");

      WebRequest request = WebRequest.Create(address);
      request.Method = "POST";
      string xml =
        "<?xml version=\"1.0\"?>\n" +
          "<version>\n" +
          "<project id=\"45\"/>\n" +
          "<name>1.0.0.10</name>\n" +
          "<due_date>2012-01-16</due_date>\n" +
          "<description>test test</description>\n" +
          "</version>";
      byte[] byteArray = Encoding.UTF8.GetBytes(xml);
      request.ContentType = "application/xml";
      request.ContentLength = byteArray.Length;
      Stream dataStream = request.GetRequestStream();
      dataStream.Write(byteArray, 0, byteArray.Length);
      dataStream.Close();
      WebResponse response = request.GetResponse();
      Console.WriteLine(((HttpWebResponse)response).StatusDescription);

I always get error 500: Internal server error.

Associated revisions

Revision 8686
Added by Jean-Philippe Lang almost 6 years ago

Makes Version REST API accept due_date attribute (#10013).

Revision 8770
Added by Jean-Philippe Lang almost 6 years ago

Backported r8686 from trunk (#10013).

History

#1 Updated by Juraj Tomana almost 6 years ago

  • Status changed from New to Resolved

Using the logs I found problem.

Despite of Rest API documentation (http://www.redmine.org/projects/redmine/wiki/Rest_Versions), parameter "due_date" is wrong. Right name of that parameter is "effective_date".

#2 Updated by Jean-Philippe Lang almost 6 years ago

  • Category set to REST API
  • Target version set to 1.3.1
  • Resolution set to Fixed

Fixed in r8686. The due_date attribute is now accepted.

#3 Updated by Jean-Philippe Lang almost 6 years ago

  • Status changed from Resolved to Closed

Merged.

Also available in: Atom PDF