Absent Member.
Absent Member.

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:

[1] IBug bug = ...
[2] IReq2 requirement = ...
[3] ILinkable linkable = (ILinkable) requirement;
[4] ILinkFactory linkFactory = (ILinkFactory) [5] linkable.BugLinkFactory;
[6] ILink link = (ILink) linkFactory.AddItem (bug);
[7] link.Post ();
[8] //Reconnect and start with [1] (second bug)

On [6] 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,
5 Replies
Absent Member.
Absent Member.

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

Absent Member.
Absent Member.

Linking requirements and defects works fine for me. My problem seems to occur after the reconnect.

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);
link.Post ();

Hope this might help.


Absent Member.
Absent Member.

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.
Absent Member.
Absent Member.

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,


Absent Member.. Absent Member..
Absent Member..

Please psot couple of statements in your code (before and after the statement wher it errors) or you closing and reconnecting statement. Thanks!
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.