Get Items by ID

Applies to QAComplete�14.4, last modified on August 06, 2024

The sample code below shows how to get a defect by its ID in your project in QAComplete. The code uses the Bugs_Load operation that returns a Bug object containing information on the needed defect.

You can get items of other types (releases, tasks, requirements, and so on) the same way you get defects. To do this, use the appropriate operations. For example, to get a release, use the Releases_Load operation; to get a requirement, use the FunctionalSpecs_Load operation and so on. For information on operations you can use to get desired items, see API Reference.

C#

string login = "[email protected]";
string password = "p@ssword";
int projID = 10372;
// Specify the defect's ID
int bugID = 5;

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;

// Get the defect by its ID and print the defect's title
Bug bug = service.Bugs_Load(authData, bugID);
Console.WriteLine(bug.Title);

Java

String login = "[email protected]";
String password = "p@ssword";
// Specify the defect's ID
int projId = 10372;
int bugID = 5;

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

// Prepare 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);

// Get the defect by its ID and print the defect's title
Bug bug = service.bugsLoad(authData, bugID);
System.out.println(bug.getTitle());

See Also

Bugs_Load Operation
How To Get Items
How To

Highlight search results