Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes



One answer

Permanent link
Hello,

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

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,950

Question asked: May 02 '13, 5:55 a.m.

Question was seen: 4,201 times

Last updated: May 02 '13, 8:16 a.m.

Confirmation Cancel Confirm