Applies to QAComplete 12.21 SaaS, last modified on July 15, 2019
Since release 10.2, this functionality is obsolete and is supported for backward compatibility only. We recommend that you use QAComplete REST API to access and manage data in QAComplete.

Use the FunctionalSpecs_LoadByCriteria operation to:

  • Get requirements that match a specific condition. For example, created by a specific user or on a specific day.

  • Get all requirements in QAComplete projects (if no condition is specified).

The operation can get requirements from one or several projects. To specify a project to get requirements from, use the ProjId value in the AuthenticationData object in the request body. To get requirements from several projects, use the ProjIds value in the AuthenticationData object to specify the list of project IDs.

LoadByCriteria returns results in pages (subsets of data) rather than all at once. Pagination is controlled by the PageSize and PageNumber parameters. For information about working with paginated results, see LoadByCriteria Operations.

You can use the Sorting parameter to sort the requirements before returning them from QAComplete.

To get just one requirement, use FunctionalSpecs_Load.

Requirements

The authenticating user must belong to a user group that has the Read privilege for Requirements.

Parameters

The operation uses the following parameters:

AuthenticationData  :  AuthenticationData, required

An AuthenticationData object with the login information and the ID of the project (or the list of project IDs) that contains the requirements.

Condition  :  string

An XML-formatted string that describes the requirements you want to get. For the syntax and examples, see Condition Syntax.

If you create SOAP requests manually, place the condition string inside CDATA.

To get all requirements, use an empty string or a null value.

Sorting  :  string

The order to sort the results before returning them from the web service. For example, by requirement ID or last updated date. The format is:

Property1 [ASC | DESC ][, Property2 [ASC | DESC ]] [, ...]]]

where property names are those of the FunctionalSpec object. If you omit ASC or DESC after a property name, requirements are sorted in ascending order.

Example values:

FunctSpecId
AssignedToName, BugId
DateUpdated DESC

To keep the default sort order, use an empty string or a null value.

PageSize  :  integer, required

Limits the number of requirements to return in one page. Possible values: 1..200.

The last page may have less items than PageSize. This means the end of the result set.

PageNumber  :  integer, required

A number starting from 1 that specifies the data page to return in the response. To get all pages, send several requests with increasing PageNumber values. For example, if PageSize is 100, PageNumber of 1 will return requirements 1..100, PageNumber of 2 – requirements 101..200 and so on.

If PageNumber exceeds the range, an empty array is returned. If PageNumber is the last page, this page may have less items than PageSize.

Result

An array of FunctionalSpec objects that contain the requirement information.

Example

Sample Code

C#

string login = "john.doe@example.com";
string password = "p@ssword";
int projId = 10372;
// Specifying the needed condition
string Condition =
@"<Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema' Operation='opEQU'>
  <Items Type='tField'>
    <Value xsi:type='xsd:string'>AssignedToName</Value>
  </Items>
  <Items Type='tString'>
    <Value xsi:type='xsd:string'>Doe, John</Value>
  </Items>
</Conditions>";

// Specifying the desired sorting
string Sorting = "FunctSpecId";
int PageSize = 10;

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;

// Getting an array of requirement
FunctionalSpec[] requirements = new FunctionalSpec[0];
int PageNumber = 1;

do
{
  requirements = service.FunctionalSpecs_LoadByCriteria(authData, Condition, Sorting, PageSize, PageNumber);
  foreach (FunctionalSpec requirement in requirements)
  {
    //Printing ID and title of each requirement
    Console.WriteLine("{0}: {1} ()", requirement.FunctSpecId, requirement.Title);

  }
PageNumber++;
} while (requirements.Length == PageSize);

Java

String login = "john.doe@example.com";
String password = "p@ssword";
int projId = 10372;
// Specifying the needed condition
String Condition =
  "<Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n" +
  "  xmlns:xsd='http://www.w3.org/2001/XMLSchema' Operation='opEQU'> \n" +
  "    <Items Type='tField'> \n" +
  "      <Value xsi:type='xsd:string'>AssignedToName</Value> \n" +
  "    </Items> \n" +
  "    <Items Type='tString'> \n" +
  "      <Value xsi:type='xsd:string'>Doe, John</Value> \n" +
  "    </Items> \n" +
  "</Conditions>";

String Sorting = "FunctSpecId";
int PageSize = 200;

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

List<FunctionalSpec> requirements;
int PageNumber = 1;
do
{
  requirements = service.functionalSpecsLoadByCriteria(authData, Condition, Sorting, PageSize, PageNumber).getFunctionalSpec();
  for (FunctionalSpec requirement : requirements)
  {
    System.out.format("%d: %s%n", requirement.getFunctSpecId(), requirement.getTitle());
  }
  PageNumber++;
} while (requirements.size()==PageSize);

Sample Request XML

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

<?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>
    <FunctionalSpec_LoadByCriteria xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <Condition>
        <![CDATA[<Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
                             xmlns:xsd='http://www.w3.org/2001/XMLSchema'
                             Operation='opEQU'>
          <Items Type='tField'>
            <Value xsi:type='xsd:string'>StatusCode</Value>
          </Items>
          <Items Type='tString'>
           <Value xsi:type='xsd:string'>Closed</Value>
          </Items>
        </Conditions>]]>
      </Condition>
      <Sorting>FunctSpecId</Sorting>
      <PageSize>200</PageSize>
      <PageNumber>1</PageNumber>
    </FunctionalSpec_LoadByCriteria>
  </soap:Body>
</soap:Envelope>

POST /psws/psws.asmx HTTP/1.1
 Host: myteam.mysite.com
 Content-Type: application/soap+xml; charset=utf-8
 Content-Length: 948 {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>
    <FunctionalSpec_LoadByCriteria xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <Condition>
        <![CDATA[<Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
                             xmlns:xsd='http://www.w3.org/2001/XMLSchema'
                             Operation='opEQU'>
          <Items Type='tField'>
            <Value xsi:type='xsd:string'>StatusCode</Value>
          </Items>
          <Items Type='tString'>
           <Value xsi:type='xsd:string'>Closed</Value>
          </Items>
        </Conditions>]]>
      </Condition>
      <Sorting>FunctSpecId</Sorting>
      <PageSize>200</PageSize>
      <PageNumber>1</PageNumber>
    </FunctionalSpec_LoadByCriteria>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 2435 {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>
    <FunctionalSpec_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
      <FunctionalSpec_LoadByCriteriaResult>
        <FunctionalSpec>
          <FunctSpecId>3</FunctSpecId>
          <Title>API-0014 - Add Visual Studio Support</Title>
          <StatusCode>Closed</StatusCode>
          <EstHrs>20.000</EstHrs>
          <ActHrs>36.100</ActHrs>
          <EstFinish>2014-07-14T17:00:00</EstFinish>
          <ActFinish>2014-07-17T17:00:00</ActFinish>
          <OwnerUserId>25315</OwnerUserId>
          <AssigneeUserId>27572</AssigneeUserId>
          <FolderId>0</FolderId>
          <EstStart>2014-07-12T15:00:00</EstStart>
          <ActStart>2014-07-13T12:15:00</ActStart>
          <PctComplete>100</PctComplete>
          <EstHrsRemaining>0.000</EstHrsRemaining>
          <AssignedToName>Davis, Eugeny</AssignedToName>
          <DateCreated>2014-07-05T04:58:35.747</DateCreated>
          <DateUpdated>2014-07-17T17:10:08.747</DateUpdated>
          <FunctionalSpecId>3</FunctionalSpecId>
          <ImportId>0</ImportId>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrTasks>0</NbrTasks>
          <NotesDescription>0</NotesDescription>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <ProjId>10372</ProjId>
          <UpdateUserId>27572</UpdateUserId>
          <UserName>Davis, Eugeny</UserName>
        </FunctionalSpec>
        <FunctionalSpec>
          <FunctSpecId>14</FunctSpecId>
          <Title>WEB-0037 - Implement the Donate Button</Title>
          <StatusCode>In Progress</StatusCode>
          <EstHrs>15.000</EstHrs>
          <ActHrs>09.000</ActHrs>
          <EstFinish>2014-08-02T12:00:00</EstFinish>
          <ActFinish>0001-01-01T00:00:00</ActFinish>
          <OwnerUserId>25315</OwnerUserId>
          <AssigneeUserId>27568</AssigneeUserId>
          <FolderId>0</FolderId>
          <EstStart>2014-08-11T08:00:00</EstStart>
          <ActStart>2014-08-13T10:20:00</ActStart>
          <PctComplete>80</PctComplete>
          <EstHrsRemaining>2.800</EstHrsRemaining>
          <AssignedToName>McLaren, Susan</AssignedToName>
          <DateCreated>2014-07-10T06:35:36.873</DateCreated>
          <DateUpdated>2014-07-16T16:48:10.624</DateUpdated>
          <FunctionalSpecId>14</FunctionalSpecId>
          <ImportId>0</ImportId>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrTasks>0</NbrTasks>
          <NotesDescription>0</NotesDescription>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <ProjId>10372</ProjId>
          <UpdateUserId>27942</UpdateUserId>
          <UserName>Doe, John</UserName>
        </FunctionalSpec>
      </FunctionalSpec_LoadByCriteriaResult>
    </FunctionalSpec_LoadByCriteriaResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 2445 {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>
    <FunctionalSpec_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
      <FunctionalSpec_LoadByCriteriaResult>
        <FunctionalSpec>
          <FunctSpecId>3</FunctSpecId>
          <Title>API-0014 - Add Visual Studio Support</Title>
          <StatusCode>Closed</StatusCode>
          <EstHrs>20.000</EstHrs>
          <ActHrs>36.100</ActHrs>
          <EstFinish>2014-07-14T17:00:00</EstFinish>
          <ActFinish>2014-07-17T17:00:00</ActFinish>
          <OwnerUserId>25315</OwnerUserId>
          <AssigneeUserId>27572</AssigneeUserId>
          <FolderId>0</FolderId>
          <EstStart>2014-07-12T15:00:00</EstStart>
          <ActStart>2014-07-13T12:15:00</ActStart>
          <PctComplete>100</PctComplete>
          <EstHrsRemaining>0.000</EstHrsRemaining>
          <AssignedToName>Davis, Eugeny</AssignedToName>
          <DateCreated>2014-07-05T04:58:35.747</DateCreated>
          <DateUpdated>2014-07-17T17:10:08.747</DateUpdated>
          <FunctionalSpecId>3</FunctionalSpecId>
          <ImportId>0</ImportId>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrTasks>0</NbrTasks>
          <NotesDescription>0</NotesDescription>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <ProjId>10372</ProjId>
          <UpdateUserId>27572</UpdateUserId>
          <UserName>Davis, Eugeny</UserName>
        </FunctionalSpec>
        <FunctionalSpec>
          <FunctSpecId>14</FunctSpecId>
          <Title>WEB-0037 - Implement the Donate Button</Title>
          <StatusCode>In Progress</StatusCode>
          <EstHrs>15.000</EstHrs>
          <ActHrs>09.000</ActHrs>
          <EstFinish>2014-08-02T12:00:00</EstFinish>
          <ActFinish>0001-01-01T00:00:00</ActFinish>
          <OwnerUserId>25315</OwnerUserId>
          <AssigneeUserId>27568</AssigneeUserId>
          <FolderId>0</FolderId>
          <EstStart>2014-08-11T08:00:00</EstStart>
          <ActStart>2014-08-13T10:20:00</ActStart>
          <PctComplete>80</PctComplete>
          <EstHrsRemaining>2.800</EstHrsRemaining>
          <AssignedToName>McLaren, Susan</AssignedToName>
          <DateCreated>2014-07-10T06:35:36.873</DateCreated>
          <DateUpdated>2014-07-16T16:48:10.624</DateUpdated>
          <FunctionalSpecId>14</FunctionalSpecId>
          <ImportId>0</ImportId>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrTasks>0</NbrTasks>
          <NotesDescription>0</NotesDescription>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <ProjId>10372</ProjId>
          <UpdateUserId>27942</UpdateUserId>
          <UserName>Doe, John</UserName>
        </FunctionalSpec>
      </FunctionalSpec_LoadByCriteriaResult>
    </FunctionalSpec_LoadByCriteriaResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

FunctionalSpecs_Add
FunctionalSpecs_Delete
FunctionalSpecs_Load
FunctionalSpecs_Update
Requirements Operations
SOAP API Reference

Highlight search results