Retrieve linked test cases from a Work Item
I have to retrieve information about the Test Cases that are linked to a given Work Item. I am using RTC 5.0.1 and Java API.
Thanks to other questions and blogposts I have managed to get throught the links of a Work Item, but I am stuck on how to retrieve the TestCase itself. Is there any way to get the Test Cases?
This method currently outputs:
Thanks to other questions and blogposts I have managed to get throught the links of a Work Item, but I am stuck on how to retrieve the TestCase itself. Is there any way to get the Test Cases?
private void getLinks(ITeamRepository repo, IWorkItem wi) throws TeamRepositoryException{
ILinkManager linkManager = (ILinkManager) repo.getClientLibrary(ILinkManager.class);
IItemReference itemReference = linkManager.referenceFactory().createReferenceToItem(wi);
ILinkCollection linkCollection = linkManager.findLinksBySource(itemReference, null).getAllLinksFromHereOn();
System.out.println("\tWorkItem has " + linkCollection.size() + " links");
for (ILink link: linkCollection) {
IItemHandle linkHandle = (IItemHandle) link.getTargetRef().resolve();
System.out.println("\t" + link.getThisEndpointDescriptor(link.getTargetRef()).getDisplayName() + " " + link.getTargetRef().getClass());
}
}
This method currently outputs:
Work Item has 1 links
Tested By Test Case class com.ibm.team.links.internal.links.impl.ReferenceImpl
Accepted answer
Unfortunately, RQM does not have a Java API like RTC.
You will need to make OSLC calls to retrieve the detail of the Test Cases.
If you need this for reporting purposes, I would consider JRS.
You will need to make OSLC calls to retrieve the detail of the Test Cases.
If you need this for reporting purposes, I would consider JRS.