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

How to Get all Parents WorkItems given a specific WorkItem with Java API?

Hello all,

How to get all parents workitems hireachy of a given work item using Java API, for example:

Epic: 1234
      |__ Story: 4567
                  |__ Task: 7894
                              |__ Another Sub Task: 7458

So given the  Sub Task: 7458    workitem handler, I'd like to get the parents up to the root:    7894, 4567 and 1234

The result of each of them can be the workitem handler and then I can get the ID number.

Thanks a lot for the help.

0 votes



One answer

Permanent link
 See http://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/
http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ shows a server example but the client API post should help and the APIs are very similar.

0 votes

Comments

Thanks for the response,
I could figure a part of the code out, but I need a part I don't know how to do it.

Part of the code I have is:

queryPage = linkManager.findLinksBySource(WorkItemLinkTypes.PARENT_WORK_ITEM, workItemRef, null);
  links = queryPage.getAllLinksFromHereOn();
  for(ILink l : links){ 
   println("Link Comment is: " + l.getTargetRef().getComment())

  }

This gives me the number of the parent WorkItem plus its title.
How can I get the IWorkItem Parent handler in my code from the ILink l?

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,948
× 411
× 169

Question asked: Oct 17 '13, 11:33 a.m.

Question was seen: 7,349 times

Last updated: Oct 17 '13, 3:07 p.m.

Confirmation Cancel Confirm