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.
One answer
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?