Feature #7366
closedREST API for Issue Relations
80%
Description
There is no Rest API for create, update, delete und select issue relations.
Files
Related issues
Updated by Alex Last over 13 years ago
REST API provides list of existing relations (#5305).
sample: http://mushroom:3000/issues/24580.xml?include=relations
<issue>
<id>24580</id>
<project name="project number 1296286327740" id="120"/>
<tracker name="Bug" id="1"/>
<status name="New" id="1"/>
<priority name="Normal" id="4"/>
<author name="Redmine Admin" id="1"/>
<subject>task 1</subject>
<description/>
<start_date>2011-07-13</start_date>
<due_date/>
<done_ratio>0</done_ratio>
<estimated_hours/>
<spent_hours>0.0</spent_hours>
<custom_fields type="array">
<custom_field name="my_custom_1" id="1">
<value/>
</custom_field>
<custom_field name="custom_boolean_1" id="2">
<value>0</value>
</custom_field>
</custom_fields>
<created_on>2011-06-30T23:06:27-07:00</created_on>
<updated_on>2011-06-30T23:07:28-07:00</updated_on>
<relations type="array">
<relation delay="" id="2" relation_type="blocks" issue_id="24581"/>
</relations>
</issue>
Updated by Jean-Philippe Lang over 13 years ago
- Status changed from New to Resolved
- Target version set to 1.3.0
- % Done changed from 0 to 80
Added in r6176. See Rest_IssueRelations.
Updated by Alex Last over 13 years ago
Excellent! Thank you very much, Jean-Philippe.
Having this API is crucial for proper MSProject-Redmine synchronization support. I hope now can properly save "predecessors" info from a Microsoft Project file into Redmine and then retrieve this info back.
Updated by Jean-Philippe Lang over 13 years ago
- Subject changed from Rest API for issue relations to REST API for Issue Relations
Updated by Alex Last over 13 years ago
http://mushroom:3030/issues.xml?limit=25&project_id=test&offset=0&include=relations
- does NOT include relations. this only works for a particular issue, not for "get issues" request.
which means if I have 100 issues to load from Redmine, I need to perform 100+1 REST API requests to Redmine to check if those tasks have any relations.
this is not good
Updated by Alex Last over 13 years ago
at least the issues list should include number of relations for every task, so that if it's not == 0, I'd load them for that particular task (instead of trying to query every single task).
This is an important feature for data import-export between Redmine and MSProject.
Updated by Jean-Philippe Lang over 13 years ago
Added in r6313. You can now use /issues?include=relations
.
Updated by Alex Last over 13 years ago
I see 1 problem with the implementation: both "forward" and "Reverse" relations are the same:
e.g. I have issues 1 and 2, 1 precedes 2.
I'd expect relations on 1 to say:
"id=.. issue_id=1 issue_to_id=2 type=precedes"
and the relation on 2:
"id=.. issue_id=2 issue_to_id=1 type=follows"
but what Redmine returns now is exactly the same relation text for both issues 1 and 2.
Updated by Alex Last over 13 years ago
- File sample_relations.xml sample_relations.xml added
here's a sample XML file to illustrate the problem
Updated by Jean-Philippe Lang over 13 years ago
- Status changed from Resolved to Closed
- Resolution set to Fixed
Alexey Skor wrote:
I see 1 problem with the implementation: both "forward" and "Reverse" relations are the same
Yes, that's because "they" are the same (look at their id), there's only one relation between 2 issues.
Delete one and "the other" will be deleted.