This function is supposed to add a new defect on HPQC. However it gives an "Value does not fall within the expected range" when null is in the .addItem(). Does anyone know what might be the problem?
public static void addBug()
{
String qcUrl = "LINK TO HPQC";
String qcDomain = "DOMAIN";
String qcProject = "PROJECT";
String qcLoginName = "NAME";
String qcPassword = "PASS";
TDConnection connection = new TDConnection();
connection.InitConnectionEx(qcUrl);
connection.ConnectProjectEx(qcDomain, qcProject, qcLoginName, qcPassword);
BugFactory bugFactory = connection.BugFactory;
Bug bug = bugFactory.AddItem(null);
bug.Status = "New";
bug.Project = "QCIntegration";
bug.Summary = "Short description of the bug";
bug.DetectedBy = "Aaron Evans";
bug.AssignedTo = "Nobody";
bug.Priority = "Low";
bug.Post();
}