Bugs_LoadByCriteria Operation

Applies to QAComplete 14.3, last modified on February 19, 2024
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 Bugs_LoadByCriteria operation to:

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

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

The operation can get defects from one or several projects. To specify a project to get defects from, use the ProjId value in the AuthenticationData object in the request body. To get defects 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 defects before returning them from QAComplete.

To get just one defect, use Bugs_Load.

Requirements

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

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 defects.

Condition  :  string (max 65536 chars)

An XML-formatted string that describes the defects 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 defects, use an empty string or a null value.

Sorting  :  string (max 512 chars)

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

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

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

Example values:

BugId
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 defects 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 defects 1..100, PageNumber of 2 – defects 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 Bug objects that contain the defect information.

Example

Sample Code

To view sample code that shows how to use the Bugs_LoadByCriteria operation to get a list of defects that meet the specified conditions, see Get Items By Condition.

To view sample code that shows how to get a list of all defects registered in your project, see Get All Defects.

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
 Host: myteam.mysite.com
 Content-Type: text/xml; charset=utf-8
 Content-Length: 915 {Insert an appropriate value here}
 SOAPAction: "http://www.pragmaticsw.com/Bugs_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>
    <Bugs_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'>Active</Value>
          </Items>
        </Conditions>]]>
      </Condition>
      <Sorting>Title</Sorting>
      <PageSize>200</PageSize>
      <PageNumber>1</PageNumber>
    </Bugs_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: 923 {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>
    <Bugs_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'>Active</Value>
          </Items>
        </Conditions>]]>
      </Condition>
      <Sorting>Title</Sorting>
      <PageSize>200</PageSize>
      <PageNumber>1</PageNumber>
    </Bugs_LoadByCriteria>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 4105 {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>
    <Bugs_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
      <Bugs_LoadByCriteriaResult>
        <Bug>
          <CustomFields>
            <string>0.9.19</string>
            <string>1.0.24</string>
          </CustomFields>
          <CustomFieldNames>
            <string>Found in build</string>
            <string>Fixed in build</string>
          </CustomFieldNames>
          <BugId>13254</BugId>
          <Title>Floating toolbar improvements</Title>
          <StatusCode>Resolved</StatusCode>
          <PriorityCode>2-Fix Soon</PriorityCode>
          <HowFoundCode>Test-Ad hoc</HowFoundCode>
          <ResolutionCode>Fixed</ResolutionCode>
          <AssigneeUserId>27942</AssigneeUserId>
          <OpenedBy>27568</OpenedBy>
          <ClosedBy>27942</ClosedBy>
          <ResolvedBy>27568</ResolvedBy>
          <Description><![CDATA[The design of the floating toolbar needs improvement so that it’s clearer what the user needs to do.]]></Description>
          <Resolution>Resolved by Susan McLaren on 24-Jun-2014 at 03:55 PM</Resolution>
          <OwnerUserId>27572</OwnerUserId>
          <TestCaseId>0</TestCaseId>
          <FolderId>52359</FolderId>
          <EstHrs>0.000</EstHrs>
          <EstStart>2014-06-10T10:00:00</EstStart>
          <EstFinish>2014-06-13T10:00:00</EstFinish>
          <PctComplete>100</PctComplete>
          <ActHrs>0.000</ActHrs>
          <ActualStart>2014-06-17T00:00:00</ActualStart>
          <ActFinish>2014-06-31T00:00:00</ActFinish>
          <EstHrsRemaining>0.000</EstHrsRemaining>
          <DateOpened>2014-05-26T15:54:21.093</DateOpened>
          <DateResolved>2014-06-24T15:55:25</DateResolved>
          <DateClosed>0001-01-01T00:00:00</DateClosed>
          <DateUpdated>2014-06-31T05:54:22</DateUpdated>
          <ProjId>17823</ProjId>
          <DateCreated>2014-05-26T15:54:21.093</DateCreated>
          <UpdateUserId>27534</UpdateUserId>
          <OriginalId>0</OriginalId>
          <ImportId>0</ImportId>
          <AssignedToName>Doe, John</AssignedToName>
          <OpenedByName>McLaren, Susan</OpenedByName>
          <OpenedByEmail>[email protected]</OpenedByEmail>
          <OpenedByCompany>Edgar Solutions</OpenedByCompany>
          <ResolvedByName>McLaren, Susan</ResolvedByName>
          <UserName>Fry, Alex</UserName>
          <OwnerName>Davis, Eugeny</OwnerName>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>1</NbrNotes>
          <NbrEvents>0</NbrEvents>
          <NbrTasks>2</NbrTasks>
          <FolderName>FamilyAlbum/Release 1.1/Iteration 1</FolderName>
        </Bug>
        <Bug>
          <CustomFields>
            <string>0.10.19</string>
            <string>1.1.24</string>
          </CustomFields>
          <CustomFieldNames>
          </CustomFieldNames>
          <BugId>13256</BugId>
          <Title>Keyboard shortcuts for the Edit menu</Title>
          <StatusCode>Resolved</StatusCode>
          <PriorityCode>2-Fix Soon</PriorityCode>
          <HowFoundCode>Test-Ad hoc</HowFoundCode>
          <ResolutionCode>Fixed</ResolutionCode>
          <AssigneeUserId>27942</AssigneeUserId>
          <OpenedBy>27572</OpenedBy>
          <ClosedBy>27942</ClosedBy>
          <ResolvedBy>27572</ResolvedBy>
          <Description><![CDATA[Keyboard shortcuts for several frequently used commands are not implemented yet. ]]></Description>
          <Resolution>Resolved by Eugeny Davis on 16-Jun-2014 at 02:15 PM</Resolution>
          <OwnerUserId>27572</OwnerUserId>
          <TestCaseId>0</TestCaseId>
          <FolderId>52364</FolderId>
          <EstHrs>0.000</EstHrs>
          <EstStart>2014-06-12T15:30:00</EstStart>
          <EstFinish>2014-06-14T17:00:00</EstFinish>
          <PctComplete>100</PctComplete>
          <ActHrs>0.000</ActHrs>
          <ActualStart>2014-06-15T09:45:00</ActualStart>
          <ActFinish>2014-06-19T18:10:00</ActFinish>
          <EstHrsRemaining></EstHrsRemaining>
          <DateOpened>2014-06-13T12:32:15.064</DateOpened>
          <DateResolved>2014-06-16T14:15:12</DateResolved>
          <DateClosed>0001-01-01T00:00:00</DateClosed>
          <DateUpdated>2014-06-26T03:12:48</DateUpdated>
          <ProjId>17823</ProjId>
          <DateCreated>2014-06-13T12:32:15.064</DateCreated>
          <UpdateUserId>27942</UpdateUserId>
          <OriginalId>0</OriginalId>
          <ImportId>0</ImportId>
          <AssignedToName>Fry, Alex</AssignedToName>
          <OpenedByName>Davis, Eugeny</OpenedByName>
          <OpenedByEmail>[email protected]</OpenedByEmail>
          <OpenedByCompany>Edgar Solutions</OpenedByCompany>
          <ResolvedByName>Davis, Eugeny</ResolvedByName>
          <UserName>Fry, Alex</UserName>
          <OwnerName>Davis, Eugeny</OwnerName>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrEvents>0</NbrEvents>
          <NbrTasks>4</NbrTasks>
          <FolderName>FamilyAlbum/Release 1.1/Iteration 1/Build 3432</FolderName>
        </Bug>
      </Bugs_LoadByCriteriaResult>
    </Bugs_LoadByCriteriaResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 4115 {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>
    <Bugs_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
      <Bugs_LoadByCriteriaResult>
        <Bug>
          <CustomFields>
            <string>0.9.19</string>
            <string>1.0.24</string>
          </CustomFields>
          <CustomFieldNames>
            <string>Found in build</string>
            <string>Fixed in build</string>
          </CustomFieldNames>
          <BugId>13254</BugId>
          <Title>Floating toolbar improvements</Title>
          <StatusCode>Resolved</StatusCode>
          <PriorityCode>2-Fix Soon</PriorityCode>
          <HowFoundCode>Test-Ad hoc</HowFoundCode>
          <ResolutionCode>Fixed</ResolutionCode>
          <AssigneeUserId>27942</AssigneeUserId>
          <OpenedBy>27568</OpenedBy>
          <ClosedBy>27942</ClosedBy>
          <ResolvedBy>27568</ResolvedBy>
          <Description><![CDATA[The design of the floating toolbar needs improvement so that it’s clearer what the user needs to do.]]></Description>
          <Resolution>Resolved by Susan McLaren on 24-Jun-2014 at 03:55 PM</Resolution>
          <OwnerUserId>27572</OwnerUserId>
          <TestCaseId>0</TestCaseId>
          <FolderId>52359</FolderId>
          <EstHrs>0.000</EstHrs>
          <EstStart>2014-06-10T10:00:00</EstStart>
          <EstFinish>2014-06-13T10:00:00</EstFinish>
          <PctComplete>100</PctComplete>
          <ActHrs>0.000</ActHrs>
          <ActualStart>2014-06-17T00:00:00</ActualStart>
          <ActFinish>2014-06-31T00:00:00</ActFinish>
          <EstHrsRemaining>0.000</EstHrsRemaining>
          <DateOpened>2014-05-26T15:54:21.093</DateOpened>
          <DateResolved>2014-06-24T15:55:25</DateResolved>
          <DateClosed>0001-01-01T00:00:00</DateClosed>
          <DateUpdated>2014-06-31T05:54:22</DateUpdated>
          <ProjId>17823</ProjId>
          <DateCreated>2014-05-26T15:54:21.093</DateCreated>
          <UpdateUserId>27534</UpdateUserId>
          <OriginalId>0</OriginalId>
          <ImportId>0</ImportId>
          <AssignedToName>Doe, John</AssignedToName>
          <OpenedByName>McLaren, Susan</OpenedByName>
          <OpenedByEmail>[email protected]</OpenedByEmail>
          <OpenedByCompany>Edgar Solutions</OpenedByCompany>
          <ResolvedByName>McLaren, Susan</ResolvedByName>
          <UserName>Fry, Alex</UserName>
          <OwnerName>Davis, Eugeny</OwnerName>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>1</NbrNotes>
          <NbrEvents>0</NbrEvents>
          <NbrTasks>2</NbrTasks>
          <FolderName>FamilyAlbum/Release 1.1/Iteration 1</FolderName>
        </Bug>
        <Bug>
          <CustomFields>
            <string>0.10.19</string>
            <string>1.1.24</string>
          </CustomFields>
          <CustomFieldNames>
          </CustomFieldNames>
          <BugId>13256</BugId>
          <Title>Keyboard shortcuts for the Edit menu</Title>
          <StatusCode>Resolved</StatusCode>
          <PriorityCode>2-Fix Soon</PriorityCode>
          <HowFoundCode>Test-Ad hoc</HowFoundCode>
          <ResolutionCode>Fixed</ResolutionCode>
          <AssigneeUserId>27942</AssigneeUserId>
          <OpenedBy>27572</OpenedBy>
          <ClosedBy>27942</ClosedBy>
          <ResolvedBy>27572</ResolvedBy>
          <Description><![CDATA[Keyboard shortcuts for several frequently used commands are not implemented yet. ]]></Description>
          <Resolution>Resolved by Eugeny Davis on 16-Jun-2014 at 02:15 PM</Resolution>
          <OwnerUserId>27572</OwnerUserId>
          <TestCaseId>0</TestCaseId>
          <FolderId>52364</FolderId>
          <EstHrs>0.000</EstHrs>
          <EstStart>2014-06-12T15:30:00</EstStart>
          <EstFinish>2014-06-14T17:00:00</EstFinish>
          <PctComplete>100</PctComplete>
          <ActHrs>0.000</ActHrs>
          <ActualStart>2014-06-15T09:45:00</ActualStart>
          <ActFinish>2014-06-19T18:10:00</ActFinish>
          <EstHrsRemaining></EstHrsRemaining>
          <DateOpened>2014-06-13T12:32:15.064</DateOpened>
          <DateResolved>2014-06-16T14:15:12</DateResolved>
          <DateClosed>0001-01-01T00:00:00</DateClosed>
          <DateUpdated>2014-06-26T03:12:48</DateUpdated>
          <ProjId>17823</ProjId>
          <DateCreated>2014-06-13T12:32:15.064</DateCreated>
          <UpdateUserId>27942</UpdateUserId>
          <OriginalId>0</OriginalId>
          <ImportId>0</ImportId>
          <AssignedToName>Fry, Alex</AssignedToName>
          <OpenedByName>Davis, Eugeny</OpenedByName>
          <OpenedByEmail>[email protected]</OpenedByEmail>
          <OpenedByCompany>Edgar Solutions</OpenedByCompany>
          <ResolvedByName>Davis, Eugeny</ResolvedByName>
          <UserName>Fry, Alex</UserName>
          <OwnerName>Davis, Eugeny</OwnerName>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrEvents>0</NbrEvents>
          <NbrTasks>4</NbrTasks>
          <FolderName>FamilyAlbum/Release 1.1/Iteration 1/Build 3432</FolderName>
        </Bug>
      </Bugs_LoadByCriteriaResult>
    </Bugs_LoadByCriteriaResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

Bugs_Add
Bugs_Delete
Bugs_GetStatuses
Bugs_Load
Bugs_Update
Defects Operations
SOAP API Reference

Highlight search results