Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 188776

Summary: [api] support task relationships
Product: z_Archived Reporter: Steffen Pingel <steffen.pingel>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: mik.kersten, robert.elves, shawn.minto, wes.coelho
Version: unspecified   
Target Milestone: 3.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip none

Description Steffen Pingel CLA 2007-05-23 16:56:37 EDT
The task list supports sub tasks (bug 187275) but tasks can have other relationships as well such as "depends on", "blocks", "duplicate of" etc. The task list should have data structures to represent these relations and visualize them. It would also be nice if the task editor displayed a list of related tasks.

JIRA actually allows to define arbitrary relations for sub-tasks. It additionally supports links between issues that are defined by an outward and inward link-description so this API needs to be rather generic.
Comment 1 Steffen Pingel CLA 2008-02-21 23:21:33 EST
These relationships could be displayed in the outline view and be accessible through the Quick Outline (Ctrl+O).
Comment 2 Eugene Kuleshov CLA 2008-02-22 01:26:26 EST
It reminds me that Task Editor outline view does not include all tabs. Bug 165859
Comment 3 Steffen Pingel CLA 2008-05-08 02:04:52 EDT
Added TaskRelation class for defining links to other tasks. I have specified three kinds of relations so far that can be created through factory methods:

 CONTAINMENT (subtasks, parent task)
 DEPENDENCY
 DUPLICATE

Each relation has direction that is either inward (e.g. parent) or outward (e.g. subtask). Here is a snippet from JiraTaskDataHandler how this works:

	public TaskRelation[] getTaskRelations(TaskData taskData) {
		List<TaskRelation> relations = new ArrayList<TaskRelation>();
		TaskAttribute attribute = taskData.getRoot().getAttribute(JiraAttribute.SUBTASK_IDS.getId());
		if (attribute != null) {
			for (String taskId : attribute.getValues()) {
				relations.add(TaskRelation.subtask(taskId));
			}
		}
		return relations.toArray(new TaskRelation[0]);
	}

The returned relations are used by the synchronization framework to build up the task list structure.
Comment 4 Steffen Pingel CLA 2008-05-08 02:04:57 EDT
Created attachment 99222 [details]
mylyn/context/zip