Project

General

Profile

Actions

Defect #6128

closed

"assigned_to" seem to be 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:
REST API
Target version:
-
Start date:
2010-08-13
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

sending request:

POST http://172.17.10.53:3000/issues.xml HTTP/1.1  -> <issue><project_id>ace</project_id><subject>test zzx</subject><assigned_to name="Alexey Skor" id="19640"/></issue>

response:

HTTP/1.1 201 Created

but the new issue's "assignee" is empty. I verified there's a user with such id.
I'm trying to use the same <issue> format as I see in the response from Redmine when I retrieve issues list.

is this REST API's limitation that assignee can't be set on issue creation or I should use different format for this field? if it's the latter, then I hope there's a documentation somewhere about that.

Actions #1

Updated by Felix Schäfer about 14 years ago

Try <assigned_to_id>USERID</assigned_to_id> in the <issue></issue> block.

Actions #2

Updated by Alex Last about 14 years ago

thanks, this works.

XML response for "get issues" and "get issue" requests has different structure, that's why I expected that parameter to be in

<assigned_to name="Alexey Skor" id="19640"/>

format. I'm using Castor XML parsing/generating library and I'd like to use the same xml-java mapping file for requests AND responses (to not duplicate stuff), but that would be only possible if both response and request had the same format (which I don't see as an unrealistic requirement).

Another my concern here is that I haven't seen this documented anywhere, so I have to spend peoples' time by asking these questions here.
what's the best way to find that kind of information? I don't know Ruby, but I can try reading Redmine source code if you tell me, which file(s) exactly to look at. I'm sure I will hit many similar stones with REST API (I'm writing 2-way synch program for Redmine-Microsoft Project).

I can also put info I find about REST API :) on some wiki page in Redmine if I have permissions.

Actions #3

Updated by Felix Schäfer about 14 years ago

Well, the XML (write) response expected is nearly 1-to-1 a copy of what the HTML forms look like. You should be able to find out the names of the required fields by looking at the html forms, keeping in mind that issue[foo][bar]=value in the HTML translates to <issue><foo><bar>value</bar></foo></issue> in XML (at least that's how I find them out).

Actions #4

Updated by Felix Schäfer about 14 years ago

  • Status changed from New to Closed

I was meaning to close that, sorry for the noise.

Actions

Also available in: Atom PDF