Obtain a task the first predecessor (Participants plugin)
I explained i have (sorry my english is bad):
I want to get the task A "IWorkItemHandle" when you save a value of task C
Task A (succesor Task B)
---> Task B (predecesor Task A, succesor task C)
----> Task C (predecesor Task B)
My code is (Participant plugin):
ISaveParameter saveParameter = (ISaveParameter) data;
List<IReferences> references=saveParameter.getNewReferences().getReferences(WorkItemEndPoints.PREDECESSOR_WORK_ITEMS) ;
if (references.isEmpty()) {
return null;
}
for (IReference reference : references) {
if (reference.isItemReference()) {
Object obj = reference.resolve();
if (obj instanceof IWorkItemHandle) {
System.out.println("6 -->" + reference.getLink().getOtherRef(reference));
return (IWorkItemHandle) obj;
} // end if
} // end if
}// end for