Get All Defects

Applies to QAComplete 14.3, last modified on February 19, 2024

The sample code below shows how to use the Bugs_LoadByCriteria operation to get all defects in your project in QAComplete. The operation gets a list of defects that meet the condition you specify. If no condition is specified, the operation gets all defects registered in your project.

You can get items of another type (releases, requirements, and so on) the same way you get defects. To do this, use the appropriate operation. For example, to get all releases registered in your project, use the Releases_LoadByCriteria operation; to get all requirements, use the FunctionalSpecs_Load operation and so on. For information on operations you can use to get desired items, see API Reference.


string login = "[email protected]";
string password = "p@ssword";
int projID = 10372;

// To get all defects, specify an empty condition
string condition = "";
// Specify sorting
string sorting = "Title";
int pageSize = 200;

ServiceSoapClient service = new ServiceSoapClient();
   // Prepare AuthenticationData
   LoginInfo loginInfo = service.GetLoginInfo("", login, password);
   AuthenticationData authData = new AuthenticationData();
   authData.AppCode = loginInfo.AppCode;
   authData.UserId = loginInfo.UserId;
   authData.PassCode = password;
   authData.DeptId = loginInfo.DeptId;
   authData.ProjId = projID;

   Bug[] bugs;
   int pageNumber = 1;
      bugs = service.Bugs_LoadByCriteria(authData, condition, sorting, pageSize, pageNumber);
      foreach (Bug bug in bugs)
         Console.WriteLine("{0}: {1}", bug.BugId, bug.Title);
   while (bugs.Length == pageSize);
catch (FaultException e)
   MessageFault msgFault = e.CreateMessageFault();
   string error = msgFault.GetReaderAtDetailContents().GetAttribute("Text");



import java.util.List;

String login = "[email protected]";
String password = "p@ssword";
int projID = 10372;

// To get all defects, specify an empty condition
String condition = "";
// Specify sorting
String sorting = "Title";
int pageSize = 200;

ServiceSoap service = new Service().getServiceSoap12();

try {
   // Preparing AuthenticationData
   LoginInfo loginInfo = service.getLoginInfo("", login, password);
   AuthenticationData authData = new AuthenticationData();

   List<Bug> bugs;
   int pageNumber = 1;
   do {
      bugs = service.bugsLoadByCriteria(authData, condition, sorting, pageSize, pageNumber).getBug();
      for (Bug bug : bugs) {
         System.out.format("%d: %s%n", bug.getBugId(), bug.getTitle());
   } while (bugs.size() == pageSize);
} catch (SOAPFaultException e) {

See Also

Bugs_LoadByCriteria Operation
How To Get Items
How To

Highlight search results