Project

General

Profile

Actions

Feature #7366

closed

REST API for Issue Relations

Added by Dimitri Sapunou about 13 years ago. Updated over 4 years ago.

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

80%

Estimated time:
Resolution:
Fixed

Description

There is no Rest API for create, update, delete und select issue relations.


Files

sample_relations.xml (2.62 KB) sample_relations.xml Alex Last, 2011-07-25 03:18

Related issues

Related to Redmine - Feature #5305: "related issues" info is required in XML dataClosed2010-04-13

Actions
Actions #1

Updated by RedminePro Yang about 13 years ago

+1

Actions #2

Updated by Dmitry Ustyuzhanin almost 13 years ago

+2

Actions #3

Updated by Alex Last over 12 years ago

+3

Actions #4

Updated by Alex Last over 12 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>

Actions #5

Updated by Jean-Philippe Lang over 12 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.

Actions #6

Updated by Alex Last over 12 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.

Actions #7

Updated by Jean-Philippe Lang over 12 years ago

  • Subject changed from Rest API for issue relations to REST API for Issue Relations
Actions #8

Updated by Alex Last over 12 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

Actions #9

Updated by Alex Last over 12 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.

Actions #10

Updated by Jean-Philippe Lang over 12 years ago

Added in r6313. You can now use /issues?include=relations.

Actions #11

Updated by Alex Last over 12 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.

Actions #12

Updated by Alex Last over 12 years ago

here's a sample XML file to illustrate the problem

Actions #13

Updated by Jean-Philippe Lang over 12 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.

Actions

Also available in: Atom PDF