ProjectTasks_LoadByCriteria Operation

Applies to QAComplete 14.5, last modified on August 06, 2024

Returns agile tasks, to do lists, and appointments that meet the specified condition. If no condition is specified, the method returns all agile tasks, to do lists, and appointments in all tests in the specified projects.

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

The method returns results in pages (subsets of data) rather than all at once. The number of pages and the number of items each page contains is controlled by the PageSize and PageNumber parameters. For information about working with pages, see LoadByCriteria Operations.

Requirements

The authenticating user must belong to a security group that has the Read privilege for Agile Tasks.

Parameters

The operation uses the following parameters:

AuthenticationData  :  , required

An AuthenticationData object with the login information and the ID of the project (or the list of project IDs) whose agile tasks, to do lists, and appointments you want to get.

Condition  :  string, required

A condition (in XML format) the agile tasks, to do lists, or appointments should meet. Wrap the condition into the CDATA tag or encode XML entities.

If you do not specify a condition, the method will return all agile tasks, to do lists, and appointments in the specified project.

Sorting  :  string, required

Specifies a property by which the method will sort the items.

PageSize  :  integer, required

Specifies how many items a single page contains (from 1 to 200).

PageNumber  :  integer, required

Specifies the number of the page from which you want to get items.

Result

An array of the ProjectTask objects that meet the criteria.

Example

Sample Code

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;

// Specify the 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'>TaskTypeCode</Value>
          </Items>
          <Items Type='tString'>
            <Value xsi:type='xsd:string'>ProjectTasks</Value>
          </Items>
        </Conditions>";

// Specify the sorting
string sorting = "TaskId";
// Specify the number of agile tasks on a page
int pageSize = 200;
// Specify the number of a page
int pageNumber = 1;

// Get the array of tasks
ProjectTask[] agileTasks;
do
{
  agileTasks = service.ProjectTasks_LoadByCriteria(authData, condition, sorting, pageSize, pageNumber);
    foreach (ProjectTask agileTask in agileTasks)
    {
      // Print ID and title of each task
      Console.WriteLine("{0}: {1}", agileTask.TaskId, agileTask.Title);
    }
  pageNumber++;
}
while (agileTasks.Length == pageSize);

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

// Specify the 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'>TaskTypeCode</Value> \n" +
          "  </Items> \n" +
          "  <Items Type='tString'> \n" +
          "    <Value xsi:type='xsd:string'>ProjectTasks</Value> \n" +
          "  </Items> \n" +
          "</Conditions>";

// Specify the sorting
String sorting = "TaskId";
// Specify the number of agile tasks on a page
int pageSize = 200;
// Specify the number of a page
int pageNumber = 1;
List<ProjectTask> agileTasks;
do
{
  // Get the array of tasks
  agileTasks = service.projectTasksLoadByCriteria(authData, condition, sorting, pageSize, pageNumber).getProjectTask();
  for (ProjectTask agileTask : agileTasks)
  {
      // Print ID and title of each task
    System.out.format("%d: %s%n", agileTask.getTaskId(), agileTask.getTitle());
  }
  pageNumber++;
}
while (agileTasks.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: 982 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/ProjectTasks_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>
    <ProjectTasks_LoadByCriteria xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>8162</DeptId>
        <ProjId>11873</ProjId>
        <UserId>24661</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <Condition> &lt;Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&#xD;
  xmlns:xsd='http://www.w3.org/2001/XMLSchema' Operation='opEQU'&gt;&#xD;
  &lt;Items Type='tField'&gt; &#xD;
    &lt;Value xsi:type='xsd:string'&gt;TaskTypeCode&lt;/Value&gt; &#xD;
  &lt;/Items&gt; &#xD;
  &lt;Items Type='tString'&gt; &#xD;
    &lt;Value xsi:type='xsd:string'&gt;ProjectTasks&lt;/Value&gt; &#xD;
  &lt;/Items&gt; &#xD;
&lt;/Conditions&gt;
</Condition>
      <Sorting>TaskId</Sorting>
      <PageSize>200</PageSize>
      <PageNumber>1</PageNumber>
    </ProjectTasks_LoadByCriteria>
  </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: 990 {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>
    <ProjectTasks_LoadByCriteria xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>8162</DeptId>
        <ProjId>11873</ProjId>
        <UserId>24661</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <Condition> &lt;Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&#xD;
  xmlns:xsd='http://www.w3.org/2001/XMLSchema' Operation='opEQU'&gt;&#xD;
  &lt;Items Type='tField'&gt; &#xD;
    &lt;Value xsi:type='xsd:string'&gt;TaskTypeCode&lt;/Value&gt; &#xD;
  &lt;/Items&gt; &#xD;
  &lt;Items Type='tString'&gt; &#xD;
    &lt;Value xsi:type='xsd:string'&gt;ProjectTasks&lt;/Value&gt; &#xD;
  &lt;/Items&gt; &#xD;
&lt;/Conditions&gt;
</Condition>
      <Sorting>TaskId</Sorting>
      <PageSize>200</PageSize>
      <PageNumber>1</PageNumber>
    </ProjectTasks_LoadByCriteria>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 3174 {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>
    <ProjectTasks_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
      <ProjectTasks_LoadByCriteriaResult>
        <ProjectTask>
          <TaskId>14</TaskId>
          <TaskTypeCode>ProjectTasks</TaskTypeCode>
          <Title>Create sample input data</Title>
          <PctComplete>37</PctComplete>
          <EstHrs>12.000</EstHrs>
          <ActualHrs>12.000</ActualHrs>
          <EstCost>16</EstCost>
          <ActualCost>0.0000</ActualCost>
          <RequestedBy>Doe, John</RequestedBy>
          <OwnerUserId>24661</OwnerUserId>
          <AssigneeUserId>24661</AssigneeUserId>
          <PriorityCode>1-High</PriorityCode>
          <StatusCode>Active</StatusCode>
          <SortOrder>0</SortOrder>
          <Description>Create a set of input values for test 1.</Description>
          <TaskUnits>0</TaskUnits>
          <TaskDuration>Hour(s)</TaskDuration>
          <ShowTimeAs>Busy</ShowTimeAs>
          <IsRecurring>N</IsRecurring>
          <IsMeeting>N</IsMeeting>
          <FirstRecurTaskId>0</FirstRecurTaskId>
          <FolderId>0</FolderId>
          <AssignedToName>Doe, John</AssignedToName>
          <DateCreated>2014-07-17T06:33:08.43</DateCreated>
          <DateUpdated>2014-07-20T22:53:07</DateUpdated>
          <EventType>Project Task</EventType>
          <FKId>0</FKId>
          <ImportId>0</ImportId>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrTasks>0</NbrTasks>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <ProjId>11873</ProjId>
          <ScheduledEventId>0</ScheduledEventId>
          <UpdateUserId>24661</UpdateUserId>
          <UserName>Doe, John</UserName>
          <ActStart>0001-01-01T00:00:00</ActStart>
          <ActFinish>0001-01-01T00:00:00</ActFinish>
          <EstStart>2014-07-18T08:00:00</EstStart>
          <EstFinish>2014-07-21T23:59:00</EstFinish>
        </ProjectTask>
        <ProjectTask>
          <TaskId>15</TaskId>
          <TaskTypeCode>ProjectTasks</TaskTypeCode>
          <Title>Specify baseline output data</Title>
          <PctComplete>25</PctComplete>
          <EstHrs>2.000</EstHrs>
          <ActualHrs>2.000</ActualHrs>
          <EstCost>0.0000</EstCost>
          <ActualCost>0.0000</ActualCost>
          <RequestedBy>Doe, John</RequestedBy>
          <OwnerUserId>24661</OwnerUserId>
          <AssigneeUserId>24661</AssigneeUserId>
          <PriorityCode>2-Medium</PriorityCode>
          <StatusCode>Active</StatusCode>
          <SortOrder>0</SortOrder>
          <Description>Create a set of output values for test 1.</Description>
          <TaskUnits>0</TaskUnits>
          <TaskDuration>Hour(s)</TaskDuration>
          <ShowTimeAs>Busy</ShowTimeAs>
          <IsRecurring>N</IsRecurring>
          <IsMeeting>N</IsMeeting>
          <FirstRecurTaskId>0</FirstRecurTaskId>
          <FolderId>0</FolderId>
          <AssignedToName>Doe, John</AssignedToName>
          <DateCreated>2014-07-18T08:27:02.38</DateCreated>
          <DateUpdated>2014-07-18T08:27:02.38</DateUpdated>
          <EventType>Project Task</EventType>
          <FKId>0</FKId>
          <ImportId>0</ImportId>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrTasks>0</NbrTasks>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <ProjId>11873</ProjId>
          <ScheduledEventId>0</ScheduledEventId>
          <UpdateUserId>24661</UpdateUserId>
          <UserName>Doe, John</UserName>
          <ActStart>0001-01-01T00:00:00</ActStart>
          <ActFinish>0001-01-01T00:00:00</ActFinish>
          <EstStart>2014-07-22T08:00:00</EstStart>
          <EstFinish>2014-07-23T23:59:00</EstFinish>
        </ProjectTask>
      </ProjectTasks_LoadByCriteriaResult>
    </ProjectTasks_LoadByCriteriaResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 3184 {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>
    <ProjectTasks_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
      <ProjectTasks_LoadByCriteriaResult>
        <ProjectTask>
          <TaskId>14</TaskId>
          <TaskTypeCode>ProjectTasks</TaskTypeCode>
          <Title>Create sample input data</Title>
          <PctComplete>37</PctComplete>
          <EstHrs>12.000</EstHrs>
          <ActualHrs>12.000</ActualHrs>
          <EstCost>16</EstCost>
          <ActualCost>0.0000</ActualCost>
          <RequestedBy>Doe, John</RequestedBy>
          <OwnerUserId>24661</OwnerUserId>
          <AssigneeUserId>24661</AssigneeUserId>
          <PriorityCode>1-High</PriorityCode>
          <StatusCode>Active</StatusCode>
          <SortOrder>0</SortOrder>
          <Description>Create a set of input values for test 1.</Description>
          <TaskUnits>0</TaskUnits>
          <TaskDuration>Hour(s)</TaskDuration>
          <ShowTimeAs>Busy</ShowTimeAs>
          <IsRecurring>N</IsRecurring>
          <IsMeeting>N</IsMeeting>
          <FirstRecurTaskId>0</FirstRecurTaskId>
          <FolderId>0</FolderId>
          <AssignedToName>Doe, John</AssignedToName>
          <DateCreated>2014-07-17T06:33:08.43</DateCreated>
          <DateUpdated>2014-07-20T22:53:07</DateUpdated>
          <EventType>Project Task</EventType>
          <FKId>0</FKId>
          <ImportId>0</ImportId>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrTasks>0</NbrTasks>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <ProjId>11873</ProjId>
          <ScheduledEventId>0</ScheduledEventId>
          <UpdateUserId>24661</UpdateUserId>
          <UserName>Doe, John</UserName>
          <ActStart>0001-01-01T00:00:00</ActStart>
          <ActFinish>0001-01-01T00:00:00</ActFinish>
          <EstStart>2014-07-18T08:00:00</EstStart>
          <EstFinish>2014-07-21T23:59:00</EstFinish>
        </ProjectTask>
        <ProjectTask>
          <TaskId>15</TaskId>
          <TaskTypeCode>ProjectTasks</TaskTypeCode>
          <Title>Specify baseline output data</Title>
          <PctComplete>25</PctComplete>
          <EstHrs>2.000</EstHrs>
          <ActualHrs>2.000</ActualHrs>
          <EstCost>0.0000</EstCost>
          <ActualCost>0.0000</ActualCost>
          <RequestedBy>Doe, John</RequestedBy>
          <OwnerUserId>24661</OwnerUserId>
          <AssigneeUserId>24661</AssigneeUserId>
          <PriorityCode>2-Medium</PriorityCode>
          <StatusCode>Active</StatusCode>
          <SortOrder>0</SortOrder>
          <Description>Create a set of output values for test 1.</Description>
          <TaskUnits>0</TaskUnits>
          <TaskDuration>Hour(s)</TaskDuration>
          <ShowTimeAs>Busy</ShowTimeAs>
          <IsRecurring>N</IsRecurring>
          <IsMeeting>N</IsMeeting>
          <FirstRecurTaskId>0</FirstRecurTaskId>
          <FolderId>0</FolderId>
          <AssignedToName>Doe, John</AssignedToName>
          <DateCreated>2014-07-18T08:27:02.38</DateCreated>
          <DateUpdated>2014-07-18T08:27:02.38</DateUpdated>
          <EventType>Project Task</EventType>
          <FKId>0</FKId>
          <ImportId>0</ImportId>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrTasks>0</NbrTasks>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <ProjId>11873</ProjId>
          <ScheduledEventId>0</ScheduledEventId>
          <UpdateUserId>24661</UpdateUserId>
          <UserName>Doe, John</UserName>
          <ActStart>0001-01-01T00:00:00</ActStart>
          <ActFinish>0001-01-01T00:00:00</ActFinish>
          <EstStart>2014-07-22T08:00:00</EstStart>
          <EstFinish>2014-07-23T23:59:00</EstFinish>
        </ProjectTask>
      </ProjectTasks_LoadByCriteriaResult>
    </ProjectTasks_LoadByCriteriaResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

ProjectTasks_Add
ProjectTasks_Delete
ProjectTasks_Load
ProjectTasks_Update
Agile Tasks Operations
SOAP API Reference

Highlight search results