ProjectPlanTasks_LoadByCriteria Operation

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

Returns an array of ProjectPlanTask objects that meet the specified condition. If no condition is specified, the method returns all tasks in all project plans.

The operation can get project plan tasks from one or several projects. To specify a project to get project plan tasks from, use the ProjId value in the AuthenticationData object in the request body. To get project plan tasks 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 tasks 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 Project Plan Tasks (Project Team Members).

Parameters

The operation uses the following parameters:

AuthenticationData  :  object, required

An AuthenticationData object with the login information and the ID of the project (or the list of project IDs) whose project plan tasks you want to get.

Condition  :  string, required

A condition (in XML format) the tasks 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 tasks in the project.

Sorting  :  string, required

Specifies a property by which the method will sort the task. If you do not specify any property for sorting, the method will sort the tasks by ID.

PageSize  :  integer, required

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

PageNumber  :  integer, required

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

Result

An array of the ProjectPlanTask objects that meet the criteria.

Example

Sample Code

C#

ServiceSoapClient service = new ServiceSoapClient();

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

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'>PriorityCode</Value>
          </Items>
          <Items Type='tString'>
            <Value xsi:type='xsd:string'>2-Medium</Value>
          </Items>
        </Conditions>";

// Specify the sorting
string Sorting = "TaskId";
// Specify the number of tasks on a page
int PageSize = 200;
// Specify the number of a page
int PageNumber = 1;

// Get the array of tasks
ProjectPlanTask[] tasks = new ProjectPlanTask[0];
do
{
  tasks = service.ProjectPlanTasks_LoadByCriteria(authData, Condition, Sorting, PageSize, PageNumber);
  foreach (ProjectPlanTask task in tasks)
  {
      // Printing ID and title of each task
      Console.WriteLine("{0}: {1} ()", task.TaskId, task.TaskName);
  }
  PageNumber++;
}
while (tasks.Length == PageSize);

Java

ServiceSoap service = new Service().getServiceSoap12();

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

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'>PriorityCode</Value> \n" +
          "  </Items> \n" +
          "  <Items Type='tString'> \n" +
          "    <Value xsi:type='xsd:string'>2-Medium</Value> \n" +
          "  </Items> \n" +
          "</Conditions>";

String Sorting = "TaskId";
String Sorting = "TaskId";
String Sorting = "TaskId";
int PageSize = 200;
int PageNumber = 1;
List<ProjectPlanTask> tasks;
do
{
  tasks = service.projectPlanTasksLoadByCriteria(authData, Condition, Sorting, PageSize, PageNumber).getProjectPlanTask();
  for (ProjectPlanTask task : tasks)
  {
    System.out.format("%d: %s%n", task.getTaskId(), task.getTaskName());
  }
  PageNumber++;
}
while (tasks.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: 865 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/ProjectPlanTasks_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>
    <ProjectPlanTasks_LoadByCriteria xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
      </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;StatusCode&lt;/Value&gt; &#xD;
  &lt;/Items&gt; &#xD;
  &lt;Items Type='tString'&gt; &#xD;
    &lt;Value xsi:type='xsd:string'&gt;Active&lt;/Value&gt; &#xD;
  &lt;/Items&gt; &#xD;
&lt;/Conditions&gt;
</Condition>
      <Sorting>TaskId</Sorting>
      <PageSize>200</PageSize>
      <PageNumber>1</PageNumber>
    </ProjectPlanTasks_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: 873 {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>
    <ProjectPlanTasks_LoadByCriteria xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
      </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;StatusCode&lt;/Value&gt; &#xD;
  &lt;/Items&gt; &#xD;
  &lt;Items Type='tString'&gt; &#xD;
    &lt;Value xsi:type='xsd:string'&gt;Active&lt;/Value&gt; &#xD;
  &lt;/Items&gt; &#xD;
&lt;/Conditions&gt;
</Condition>
      <Sorting>TaskId</Sorting>
      <PageSize>200</PageSize>
      <PageNumber>1</PageNumber>
    </ProjectPlanTasks_LoadByCriteria>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 3167 {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>
    <ProjectPlanTasks_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
      <ProjectPlanTasks_LoadByCriteriaResult>
        <ProjectPlanTask>
          <TaskId>25</TaskId>
          <TaskName>Test new input controls</TaskName>
          <ProjPlanId>1</ProjPlanId>
          <Indent>3</Indent>
          <IsParent>Y</IsParent>
          <IsExpanded>N</IsExpanded>
          <SeqNum>6</SeqNum>
          <PredNum>5</PredNum>
          <EstStart>2014-07-18T08:00:00</EstStart>
          <EstFinish>2014-07-21T18:00:00</EstFinish>
          <EstHrs>12.000</EstHrs>
          <EstCostInt>60</EstCostInt>
          <EstCostExt>18</EstCostExt>
          <ActStart>0001-01-01T00:00:00</ActStart>
          <ActFinish>0001-01-01T00:00:00</ActFinish>
          <ActHrs>0.000</ActHrs>
          <ActCostInt>0</ActCostInt>
          <ActCostExt>0</ActCostExt>
          <RequestedBy>Doe, John</RequestedBy>
          <AssigneeUserId>24661</AssigneeUserId>
          <PriorityCode>2-Medium</PriorityCode>
          <PctComplete>0</PctComplete>
          <Description>New task description.</Description>
          <FunctSpecId>0</FunctSpecId>
          <IsBillable>Y</IsBillable>
          <EstHrsRemaining>4.000</EstHrsRemaining>
          <LinkedItemId>0</LinkedItemId>
          <AssignedToName>Doe, John</AssignedToName>
          <DateCreated>2014-07-17T06:33:08.43</DateCreated>
          <DateUpdated>2014-07-20T22:53:07</DateUpdated>
          <ImportId>0</ImportId>
          <IsActive>Y</IsActive>
          <IsEstFinishOverriden>N</IsEstFinishOverriden>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <OwnerUserId>24661</OwnerUserId>
          <ProjId>11873</ProjId>
          <ProjPlanName>Test Plan</ProjPlanName>
          <UpdateUserId>24661</UpdateUserId>
          <UserName>Doe, John</UserName>
        </ProjectPlanTask>
        <ProjectPlanTask>
          <TaskId>26</TaskId>
          <TaskName>Test new list controls</TaskName>
          <ProjPlanId>1</ProjPlanId>
          <Indent>3</Indent>
          <IsParent>N</IsParent>
          <IsExpanded>N</IsExpanded>
          <SeqNum>7</SeqNum>
          <PredNum>6</PredNum>
          <EstStart>2014-07-22T08:00:00</EstStart>
          <EstFinish>2014-07-23T18:00:00</EstFinish>
          <EstHrs>8.000</EstHrs>
          <EstCostInt>12</EstCostInt>
          <EstCostExt>4</EstCostExt>
          <ActStart>0001-01-01T00:00:00</ActStart>
          <ActFinish>0001-01-01T00:00:00</ActFinish>
          <ActHrs>0.000</ActHrs>
          <ActCostInt>0</ActCostInt>
          <ActCostExt>0</ActCostExt>
          <RequestedBy>Doe, John</RequestedBy>
          <AssigneeUserId>24661</AssigneeUserId>
          <PriorityCode>2-Medium</PriorityCode>
          <PctComplete>0</PctComplete>
          <Description>New task description.</Description>
          <FunctSpecId>0</FunctSpecId>
          <IsBillable>Y</IsBillable>
          <EstHrsRemaining>0.000</EstHrsRemaining>
          <LinkedItemId>0</LinkedItemId>
          <AssignedToName>Doe, John</AssignedToName>
          <DateCreated>2014-07-18T06:33:08.43</DateCreated>
          <DateUpdated>2014-07-22T22:53:07</DateUpdated>
          <ImportId>0</ImportId>
          <IsActive>Y</IsActive>
          <IsEstFinishOverriden>N</IsEstFinishOverriden>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <OwnerUserId>24661</OwnerUserId>
          <ProjId>11873</ProjId>
          <ProjPlanName>Test Plan</ProjPlanName>
          <UpdateUserId>24661</UpdateUserId>
          <UserName>Doe, John</UserName>
        </ProjectPlanTask>
      </ProjectPlanTasks_LoadByCriteriaResult>
    </ProjectPlanTasks_LoadByCriteriaResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 3177 {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>
    <ProjectPlanTasks_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
      <ProjectPlanTasks_LoadByCriteriaResult>
        <ProjectPlanTask>
          <TaskId>25</TaskId>
          <TaskName>Test new input controls</TaskName>
          <ProjPlanId>1</ProjPlanId>
          <Indent>3</Indent>
          <IsParent>Y</IsParent>
          <IsExpanded>N</IsExpanded>
          <SeqNum>6</SeqNum>
          <PredNum>5</PredNum>
          <EstStart>2014-07-18T08:00:00</EstStart>
          <EstFinish>2014-07-21T18:00:00</EstFinish>
          <EstHrs>12.000</EstHrs>
          <EstCostInt>60</EstCostInt>
          <EstCostExt>18</EstCostExt>
          <ActStart>0001-01-01T00:00:00</ActStart>
          <ActFinish>0001-01-01T00:00:00</ActFinish>
          <ActHrs>0.000</ActHrs>
          <ActCostInt>0</ActCostInt>
          <ActCostExt>0</ActCostExt>
          <RequestedBy>Doe, John</RequestedBy>
          <AssigneeUserId>24661</AssigneeUserId>
          <PriorityCode>2-Medium</PriorityCode>
          <PctComplete>0</PctComplete>
          <Description>New task description.</Description>
          <FunctSpecId>0</FunctSpecId>
          <IsBillable>Y</IsBillable>
          <EstHrsRemaining>4.000</EstHrsRemaining>
          <LinkedItemId>0</LinkedItemId>
          <AssignedToName>Doe, John</AssignedToName>
          <DateCreated>2014-07-17T06:33:08.43</DateCreated>
          <DateUpdated>2014-07-20T22:53:07</DateUpdated>
          <ImportId>0</ImportId>
          <IsActive>Y</IsActive>
          <IsEstFinishOverriden>N</IsEstFinishOverriden>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <OwnerUserId>24661</OwnerUserId>
          <ProjId>11873</ProjId>
          <ProjPlanName>Test Plan</ProjPlanName>
          <UpdateUserId>24661</UpdateUserId>
          <UserName>Doe, John</UserName>
        </ProjectPlanTask>
        <ProjectPlanTask>
          <TaskId>26</TaskId>
          <TaskName>Test new list controls</TaskName>
          <ProjPlanId>1</ProjPlanId>
          <Indent>3</Indent>
          <IsParent>N</IsParent>
          <IsExpanded>N</IsExpanded>
          <SeqNum>7</SeqNum>
          <PredNum>6</PredNum>
          <EstStart>2014-07-22T08:00:00</EstStart>
          <EstFinish>2014-07-23T18:00:00</EstFinish>
          <EstHrs>8.000</EstHrs>
          <EstCostInt>12</EstCostInt>
          <EstCostExt>4</EstCostExt>
          <ActStart>0001-01-01T00:00:00</ActStart>
          <ActFinish>0001-01-01T00:00:00</ActFinish>
          <ActHrs>0.000</ActHrs>
          <ActCostInt>0</ActCostInt>
          <ActCostExt>0</ActCostExt>
          <RequestedBy>Doe, John</RequestedBy>
          <AssigneeUserId>24661</AssigneeUserId>
          <PriorityCode>2-Medium</PriorityCode>
          <PctComplete>0</PctComplete>
          <Description>New task description.</Description>
          <FunctSpecId>0</FunctSpecId>
          <IsBillable>Y</IsBillable>
          <EstHrsRemaining>0.000</EstHrsRemaining>
          <LinkedItemId>0</LinkedItemId>
          <AssignedToName>Doe, John</AssignedToName>
          <DateCreated>2014-07-18T06:33:08.43</DateCreated>
          <DateUpdated>2014-07-22T22:53:07</DateUpdated>
          <ImportId>0</ImportId>
          <IsActive>Y</IsActive>
          <IsEstFinishOverriden>N</IsEstFinishOverriden>
          <NbrEvents>0</NbrEvents>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <OriginalId>0</OriginalId>
          <OwnerName>Doe, John</OwnerName>
          <OwnerUserId>24661</OwnerUserId>
          <ProjId>11873</ProjId>
          <ProjPlanName>Test Plan</ProjPlanName>
          <UpdateUserId>24661</UpdateUserId>
          <UserName>Doe, John</UserName>
        </ProjectPlanTask>
      </ProjectPlanTasks_LoadByCriteriaResult>
    </ProjectPlanTasks_LoadByCriteriaResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

ProjectPlanTasks_Add
ProjectPlanTasks_Delete
ProjectPlanTasks_Load
ProjectPlanTasks_Update
Project Operations
Project Plan Tasks Operations
SOAP API Reference

Highlight search results