Add Notes to Defects

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

The code below uses the Notes_Add operation to add a note to a defect in QAComplete. In a similar way, you can add notes to releases, requirements and other items. Just change the EntityCode (item type) and FKId (item ID) properties of the Notes object appropriately.

C#

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

// Project and item to add note to
int projID = 10372;
string itemType = "Bugs";
int itemID = 3;

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;

// Prepare the Notes object
Notes note = new Notes();
note.EntityCode = itemType;
note.FKId = itemID;
note.Description = "A note.";

// Add the note
service.Notes_Add(authData, note);

Java

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

// Project and item to add note to
int projID = 10372;
String itemType = "Bugs";
int itemID = 3;

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

// Prepare the Notes object
Notes note = new Notes();
note.setEntityCode(itemType);
note.setFKId(itemID);
note.setDescription("A note");

// Add the note
service.notesAdd(authData, note);

See Also

SOAP API Introduction
How To
Notes_Add Operation

Highlight search results