ProjectPlanTasks_Add Operation

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

Adds a new task to the project plan in QAComplete and returns the ID of the added task.

Requirements

The authenticating user must belong to a security group that has the following privileges:

  • Add access to Project Plan Tasks (Project Team Members).

  • Update access to the Project Plan Maintenance (Project Manager).

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

ProjectPlanTask  :  ProjectPlanTask, required

The ProjectPlanTask object to add to the project plan.

SendEmailAlert  :  string, required

Y if you want to send an email alert; N otherwise.

NewNotes  :  string, required

A note to attach to the task.

Result

The ID of the added task.

Remarks

The ProjectPlanTask object you pass to the method must have the ProjPlanId and TaskName properties specified.

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;

// Prepare the ProjectPlanTask object
ProjectPlanTask task = new ProjectPlanTask();
task.ProjPlanId = 4;
task.TaskName = "Test new input controls";
task.Indent = 3;
task.SeqNum = 6;
task.PredNum = "5";
task.EstStart = DateTime.Today;
task.EstFinish = DateTime.Today.AddDays(1);
task.EstHrs = 12;
task.IsBillable = "Y";
task.EstCostInt = 60;
task.EstCostExt = 18;
task.AssigneeUserId = 24661;

// Add the task
int taskId = service.ProjectPlanTasks_Add(authData, task, "Y", null);

Java

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

ServiceSoap service = new Service().getServiceSoap12();
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 ProjectPlanTask object
ProjectPlanTask task = new ProjectPlanTask();
task.setProjPlanId(4);
task.setTaskName("Test new input controls");
task.setIndent(3);
task.setSeqNum(8);
task.setPredNum("7");

try
{
  XMLGregorianCalendar startDate;
  XMLGregorianCalendar finishDate;

  startDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar());
  finishDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar());
  finishDate.setDay(startDate.getDay() + 1);
  task.setEstStart(startDate);
  task.setEstFinish(finishDate);
}
catch (Exception e)
{
  e.printStackTrace();
}

task.setEstHrs(new BigDecimal(12.0));
task.setIsBillable("Y");
task.setEstCostInt(new BigDecimal(60.0));
task.setEstCostExt(new BigDecimal(18.0));
task.setAssigneeUserId(24661);

// Add the task
int taskId = service.projectPlanTasksAdd(authData, task, "Y", null);

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 1525 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/ProjectPlanTasks_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>
    <ProjectPlanTasks_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>8162</DeptId>
        <ProjId>11873</ProjId>
        <UserId>24661</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <ProjectPlanTask>
        <TaskId>0</TaskId>
        <TaskName>Test new input controls</TaskName>
        <ProjPlanId>1</ProjPlanId>
        <Indent>3</Indent>
        <IsParent>Y</IsParent>
        <SeqNum>6</SeqNum>
        <PredNum>5</PredNum>
        <EstStart>2014-07-18T08:00:00</EstStart>
        <EstFinish>2014-07-21T18:00:00</EstFinish>
        <EstHrs>12</EstHrs>
        <EstCostInt>60</EstCostInt>
        <EstCostExt>18</EstCostExt>
        <ActStart>0001-01-01T00:00:00</ActStart>
        <ActFinish>0001-01-01T00:00:00</ActFinish>
        <ActHrs>0</ActHrs>
        <ActCostInt>0</ActCostInt>
        <ActCostExt>0</ActCostExt>
        <AssigneeUserId>24661</AssigneeUserId>
        <PctComplete>0</PctComplete>
        <FunctSpecId>0</FunctSpecId>
        <IsBillable>Y</IsBillable>
        <EstHrsRemaining>0</EstHrsRemaining>
        <LinkedItemId>0</LinkedItemId>
        <DateCreated>0001-01-01T00:00:00</DateCreated>
        <DateUpdated>0001-01-01T00:00:00</DateUpdated>
        <ImportId>0</ImportId>
        <NbrEvents>0</NbrEvents>
        <NbrFiles>0</NbrFiles>
        <NbrNotes>0</NbrNotes>
        <OriginalId>0</OriginalId>
        <OwnerUserId>0</OwnerUserId>
        <ProjId>0</ProjId>
        <UpdateUserId>0</UpdateUserId>
      </ProjectPlanTask>
      <SendEmailAlert>Y</SendEmailAlert>
      <NewNotes>A note.</NewNotes>
    </ProjectPlanTasks_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: 1533 {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_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>8162</DeptId>
        <ProjId>11873</ProjId>
        <UserId>24661</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <ProjectPlanTask>
        <TaskId>0</TaskId>
        <TaskName>Test new input controls</TaskName>
        <ProjPlanId>1</ProjPlanId>
        <Indent>3</Indent>
        <IsParent>Y</IsParent>
        <SeqNum>6</SeqNum>
        <PredNum>5</PredNum>
        <EstStart>2014-07-18T08:00:00</EstStart>
        <EstFinish>2014-07-21T18:00:00</EstFinish>
        <EstHrs>12</EstHrs>
        <EstCostInt>60</EstCostInt>
        <EstCostExt>18</EstCostExt>
        <ActStart>0001-01-01T00:00:00</ActStart>
        <ActFinish>0001-01-01T00:00:00</ActFinish>
        <ActHrs>0</ActHrs>
        <ActCostInt>0</ActCostInt>
        <ActCostExt>0</ActCostExt>
        <AssigneeUserId>24661</AssigneeUserId>
        <PctComplete>0</PctComplete>
        <FunctSpecId>0</FunctSpecId>
        <IsBillable>Y</IsBillable>
        <EstHrsRemaining>0</EstHrsRemaining>
        <LinkedItemId>0</LinkedItemId>
        <DateCreated>0001-01-01T00:00:00</DateCreated>
        <DateUpdated>0001-01-01T00:00:00</DateUpdated>
        <ImportId>0</ImportId>
        <NbrEvents>0</NbrEvents>
        <NbrFiles>0</NbrFiles>
        <NbrNotes>0</NbrNotes>
        <OriginalId>0</OriginalId>
        <OwnerUserId>0</OwnerUserId>
        <ProjId>0</ProjId>
        <UpdateUserId>0</UpdateUserId>
      </ProjectPlanTask>
      <SendEmailAlert>Y</SendEmailAlert>
      <NewNotes>A note.</NewNotes>
    </ProjectPlanTasks_Add>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 402 {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_AddResponse xmlns="http://www.pragmaticsw.com/">
      <ProjectPlanTasks_AddResult>25</ProjectPlanTasks_AddResult>
    </ProjectPlanTasks_AddResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 412 {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_AddResponse xmlns="http://www.pragmaticsw.com/">
      <ProjectPlanTasks_AddResult>25</ProjectPlanTasks_AddResult>
    </ProjectPlanTasks_AddResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

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

Highlight search results