API JAVA : Find the type of workitem childs
Hello,
i try to get the type of the workitems child from a Parent.
i can find the references with this code :
IWorkItemReferences references =
wiServer.resolveWorkItemReferences(currentWorkItem, null);
List<IReference> listChilds = references.getReferences(WorkItemEndPoints.CHILD_WORK_ITEMS);
But i don't know how catch the type of this workitems child from the reference list.
Thanks for your help..
antoine
One answer
Hello,
Maybe something like this :
Regards,
Sylvain
Maybe something like this :
for(IReference ref : listChilds) { if(ref.isItemReference()) {
IItemReference refItem = (IItemReference) ref;
IItemHandle itemHandle = refItem.getReferencedItem();
IItem item = repo.itemManager().fetchCompleteItem(itemHandle, IItemManager.DEFAULT, null);
if(item instanceof IWorkItem) {
System.out.println(((IWorkItem)item).getWorkItemType());
}
}
}
Regards,
Sylvain