OTA QC9.2: Interop ILinkable.BugLinkFactory (Requirement <=> Bug)
I got the following problem when linking requirements to defects with OTA:
Creating several "requirement to bug" links over OTA only works for the first time accessing the IRequirement.BugLinkFactory object. The links are visible in the QC-GUI and the db entries look exactly like the ones created from the QC-GUI.
When I try to add another "requirement to bug" link to the same requirement and different defect, I got an exception telling me "Your Quality Center session has been disconnected. Contact your system administrator for more information" (Unknown error).
IMPORTANT FACT: That only happens if I reconnect between adding links with OTA. Within one connection it is possible to add several bugs to an requirement - Same requirement but different instances.
Here's the snippet:
 IBug bug = ...
 IReq2 requirement = ...
 ILinkable linkable = (ILinkable) requirement;
 ILinkFactory linkFactory = (ILinkFactory)  linkable.BugLinkFactory;
 ILink link = (ILink) linkFactory.AddItem (bug);
 link.Post ();
 //Reconnect and start with  (second bug)
On  the exception is thrown (after reconnect). I also tried linkFactory.AddItem (bug.Id) and linkFactory.AddItem (System.DBNull.Value) followed by setting the TargetEntity - no luck.
Adding the first buglink with QC-GUI and (reconnect) adding the second buglink with OTA works. (reconnect) Adding a third buglink with OTA results in the exception.
Adding the first buglink with OTA and adding the second and third buglink with QC-GUI works. (reconnect) Adding another buglink with OTA results in the exception.
It looks like the modified requirement BugLinkFactory is corrupt or maybe locked after adding links to it. As I mentioned before only reconnecting causes the problem.
Any help would be appreciated.
Thanks in advance and best regards,
I am trying to link a posted requirement to a defect , but it fails the first time as well. This is because I do not have the requirement id .
Are you able to create a link between a requirement and defect with just the requirement object or name via vbscript? If yes please let me know
The following should link a requirement object with a bug (not translated to vbscript):
ILinkable linkable = (ILinkable) YourReqObj;
ILink link = (ILink) YourReqObj.BugLinkFactory.AddItem (YourBugObj);
Hope this might help.
Thanks a lot. The problem is that vbscript is not implememting Ilinkable or link object . I could only create the Bug, req and Linkfactory objects.
maybe I am missing something, not sure what.
I know that the original first post is from 2009, but I decided to try my luck. Maybe there is some answer out there waiting for me 🙂
I got nearly the same problem.
My BugLinkFactory object does not create a NewList("") after a reconnect. In one session, everything is working fine, but when I reconnect (in my case by cancelling the operation and starting it again) the QC connection, it fails and throws an exception respectively access violation in OTAClient.dll (literally like: "access violation at 0x00000000")
Is there any hint, why this happens only when reconnecting and only with BugLinkFactory? For example TestFactory is working fine....
Thank you in advance,