I am trying to link defects to requirements using the OTA API in Java (via ComfyJ). I can't figure out how to cast the IReq3 interface to the ILinkable interface. Does anyone have any experience with comfyJ and OTA that might be able to solve the below:
Code:
// Get BugLinkFactory
IReq3 req = findRequirement(1);
ILinkable linkableReq = (ILinkable)req; //This is the line that causes the error
ILinkFactory bugLinkF = LinkFactory.queryInterface(linkableReq.getBugLinkFactory());
// Add new traces
ILink bToRLink = Link.queryInterface(bugLinkF.addItem(new Variant(traceID)));
bToRLink.setLinkType(new BStr("Related"));
bToRLink.post();
Error:
IReq3 cannot be cast to type ILinkable