Folders_Add Operation

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

Adds a new folder to the specified QAComplete project and area (Defects, Test Library, and so on). The project and area are specified by the AuthenticationData.ProjId and Folder.EntityCode parameters.

Requirements

The web service user must belong to a security group that has the Add privilege for Folder Maintenance in the appropriate area.

Parameters

The operation uses the following parameters:

AuthenticationData  :  AuthenticationData, required

An AuthenticationData object containing the login information and the project ID to which you want to add a folder.

Folder  :  Folder, required

A Folder object that contains the folder data. This object must have at least the FolderName, EntityCode, IsActive, and IsVersion properties specified.

Result

An integer ID of the added folder.

Remarks

The Folder object has matching Id and Name properties, for example, OwnerUserId and OwnerUserName. To set them, specify the value only for the Id property. The corresponding Name property will be set automatically.

Example

Sample Code

This example adds a subfolder named Product Backlogs to the Backlogs folder in Defects.

C#

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

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 = loginInfo.ProjId;

// Prepare the Folder object
Folder folder = new Folder();
folder.FolderName = "Product Backlogs";
folder.EntityCode = "Bugs";
folder.IsActive = "Y";
folder.IsVersion = "N";
folder.Description = "Recent product backlogs";
folder.ParentName = "Backlogs";

// Add the folder
int folderId = service.Folders_Add(authData, folder);

Java

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

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(loginInfo.getProjId());

// Prepare the Folder object
Folder folder = new Folder();
folder.setFolderName("Product Backlogs");
folder.setEntityCode("Bugs");
folder.setIsActive("Y");
folder.setIsVersion("N");
folder.setDescription("Recent product backlogs");
folder.setParentName("Backlogs");

// Add the folder
int folderId = service.foldersAdd(authData, folder);

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 683 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/Folders_Add"
 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Folders_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>8162</DeptId>
        <ProjId>11873</ProjId>
        <UserId>24661</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <Folder>
        <FolderName>Product Backlogs</FolderName>
        <Description>Recent product backlogs</Description>
        <EntityCode>Bugs</EntityCode>
        <ParentName>Backlogs</ParentName>
        <IsActive>Y</IsActive>
        <IsVersion>N</IsVersion>
      </Folder>
    </Folders_Add>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 691 {Insert an appropriate value here}
 

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <Folders_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>8162</DeptId>
        <ProjId>11873</ProjId>
        <UserId>24661</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <Folder>
        <FolderName>Product Backlogs</FolderName>
        <Description>Recent product backlogs</Description>
        <EntityCode>Bugs</EntityCode>
        <ParentName>Backlogs</ParentName>
        <IsActive>Y</IsActive>
        <IsVersion>N</IsVersion>
      </Folder>
    </Folders_Add>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 365 {The server returns an appropriate value here}
 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Folders_AddResponse xmlns="http://www.pragmaticsw.com/">
      <Folders_AddResult>4</Folders_AddResult>
    </Folders_AddResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 375 {The server returns an appropriate value here}
 

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <Folders_AddResponse xmlns="http://www.pragmaticsw.com/">
      <Folders_AddResult>4</Folders_AddResult>
    </Folders_AddResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

Folders_Delete
Folders_Load
Folders_LoadByCriteria
Folders_Update
Folders Operations
SOAP API Reference

Highlight search results