How to fetch work item parent?
One answer
Given a workitem, you would search its references for 'Parent' links,
and use the handle of the workitem on the other end of the parent link.
here is how I do it for Dependancies.. (in an OperationAdvisor)
and use the handle of the workitem on the other end of the parent link.
here is how I do it for Dependancies.. (in an OperationAdvisor)
IWorkItemReferences iwr = ((ISaveParameter) data).getNewReferences();
// and only the depends on links
List<IReference> wir = iwr.getReferences(WorkItemEndPoints.DEPENDS_ON_WORK_ITEM);
// loop thru the workitems this one depends on
for(int j=0;wir!=null && j<wir.size();j++)
{
if(Debug) System.out.println("looping thru references");
// if this is to an item.. should always be
if(wir.get(j).isItemReference())
{
// get the item, and it SHOULD always be a workitem
IWorkItem r = iac.resolveAuditable(
(IWorkItemHandle)wir.get(j).
resolve(),IWorkItem.FULL_PROFILE, null);