Create Defects

Applies to QAComplete 14.5, last modified on August 06, 2024

The code below uses the Bugs_Add operation to add a new defect to a QAComplete project.

You can create other items (releases, requirements, agile tasks, and so on) in a similar way using the corresponding operation – Releases_Add for releases, FunctionalSpecs_Add for requirements, and so on. For a list of available operations, see SOAP API Reference.

C#

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

ServiceSoapClient service = new ServiceSoapClient();

// Preparing 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;

// Specify defect information
Bug bug = new Bug();
bug.Title = "Sample defect";
bug.Description = "Sample description";
bug.PriorityCode = "2-Fix Soon";
bug.StatusCode = "Active";

// Add a defect
int bugId = service.Bugs_Add(authData, bug, "N", "");
Console.WriteLine("ID of the created defect: {0}", bugId);

Java

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

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

// Preparing AuthenticationData
LoginInfo loginInfo = service.getLoginInfo("", login, password);
AuthenticationData authData = new AuthenticationData();
authData.setAppCode(loginInfo.getAppCode());
authData.setUserId(loginInfo.getUserId());
authData.setPassCode(password);
authData.setDeptId(loginInfo.getDeptId());
authData.setProjId(projId);

// Specify defect information
Bug bug = new Bug();
bug.setTitle("Sample defect");
bug.setDescription("Sample description");
bug.setPriorityCode("2-Fix Soon");
bug.setStatusCode("Active");

// Add a defect
int bugId = service.bugsAdd(authData, bug, "N", "");
System.out.format("ID of the created defect: %d", bugId);

See Also

SOAP API Introduction
How To
Bugs_Add Operation

Highlight search results