Project

General

Profile

Actions

Defect #6126

closed

"project id" node is ignored when creating issues via REST API

Added by Alex Last about 14 years ago. Updated about 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-08-13
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

this is the XML body I'm sending from my program to Redmine (last trunk version):

<issue><project_id>ace</project_id><parent id="46"/><subject>child 1</subject></issue>

POST http://172.17.10.53:3000/issues.xml HTTP/1.1
----------------------------------------
response from server:

HTTP/1.1 201 Created
Response content length: 603
<?xml version="1.0" encoding="UTF-8"?>
<issue>
  <id>51</id>
  <project name="ace" id="7"/>
  <tracker name="Bug" id="1"/>
  <status name="New" id="1"/>
  <priority name="Normal" id="4"/>
  <author name="Redmine Admin" id="1"/>
  <subject>child 1</subject>
  <description></description>
  <start_date>2010-08-12</start_date>
  <due_date></due_date>
  <done_ratio>0</done_ratio>
  <estimated_hours></estimated_hours>
  <spent_hours>0.0</spent_hours>
  <created_on>Thu Aug 12 16:44:44 -0700 2010</created_on>
  <updated_on>Thu Aug 12 16:44:44 -0700 2010</updated_on>
  <relations>
  </relations>
</issue>

my output:

created child: issue: id=51 assignee: subject:child 1

I have the issue with id "46" in the same "ace" project so I expect the new issue to be created with the parent link, but it's created with no parent.

here's Redmine log:

Processing IssuesController#create to xml (for 172.17.10.62 at 2010-08-12 16:44:39) [POST]
  Parameters: {"format"=>"xml", "action"=>"create", "issue"=>{"parent"=>{"id"=>"46"}, "project_id"=>"ace", "subject"=>"child 1"}, "controller"=>"issues"}
Filter chain halted as [:check_if_login_required] rendered_or_redirected.
Completed in 13ms (View: 0, DB: 7) | 401 Unauthorized [http://172.17.10.53/issues.xml]

Processing IssuesController#create to xml (for 172.17.10.62 at 2010-08-12 16:44:44) [POST]
  Parameters: {"format"=>"xml", "action"=>"create", "issue"=>{"parent"=>{"id"=>"46"}, "project_id"=>"ace", "subject"=>"child 1"}, "controller"=>"issues"}
Sending email notification to: admin@example.net
Rendering issues/show (created)
Completed in 242ms (View: 15, DB: 123) | 201 Created [http://172.17.10.53/issues.xml]

Actions #1

Updated by Felix Schäfer about 14 years ago

<parent_issue_id>46</parent_issue_id>

Actions #2

Updated by Alex Last about 14 years ago

this works, thanks.

see my comment for task #6128 : http://www.redmine.org/issues/6128#note-2

Actions #3

Updated by Alex Last about 14 years ago

btw, just noticed that I made a mistake in "subject" field: should be "parent id" instead of "project_id"

Actions #4

Updated by Alex Last about 14 years ago

  • Status changed from New to Resolved
Actions #5

Updated by Felix Schäfer about 14 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF