ProjectTasks_Add Operation

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

Adds a new agile task, to do list or appointment to the project in QAComplete and returns the ID of the added item.

Requirements

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

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, to do list, or appointment.

ProjectTask  :  ProjectTask, required

The ProjectTask object that represents the agile task, to do list, or appointment you want to add to the project.

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 agile task, to do list, or appointment.

Remarks

The ProjectTask object you pass to the method must have all properties required by your instance of QAComplete specified. To learn what properties are required:

  • In QAComplete, go to  > Setup > System Configuration > Screen Layouts > Agile Tasks > Required Fields. View the required agile task properties on the Required Fields list.

  • In QAComplete, open Agile Tasks > Show Agile Tasks > Actions > Manage Workflows. Select the desired task status on the Status list and click Select fields for this Transition to view the list of required task properties.

The ProjectTask object has matching Id and Name properties, for example, FolderId and FolderName. To set them, specify the value only for the Id property. The corresponding Name property will be set automatically.

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;

// Prepare the ProjectTask object
ProjectTask agileTask = new ProjectTask();
agileTask.Title = "Create sample input data";
agileTask.TaskTypeCode = "ProjectTasks";
agileTask.PctComplete = 37;
agileTask.EstHrs = 12;
agileTask.AssigneeUserId = 24661;
agileTask.EstStart = DateTime.Today;
agileTask.EstFinish = DateTime.Today.AddDays(1);

// Add the task
int agileTaskId = service.ProjectTasks_Add(authData, agileTask, "Y", "");

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

// Prepare the ProjectTask object
ProjectTask agileTask = new ProjectTask();
agileTask.setTitle("Create sample input data");
agileTask.setTaskTypeCode("ProjectTasks");
agileTask.setPctComplete(37);
agileTask.setEstHrs(new BigDecimal(12.0));
agileTask.setAssigneeUserId(24661);
try
{
  XMLGregorianCalendar startDate;
  XMLGregorianCalendar finishDate;
  startDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar());
  finishDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar());
  finishDate.setDay(startDate.getDay() + 1);
  agileTask.setEstStart(startDate);
  agileTask.setEstFinish(finishDate);
}
catch (Exception e)
{
  e.printStackTrace();
}

// Add the task
int agileTaskId = service.projectTasksAdd(authData, agileTask, "Y", "");

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 745 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/ProjectTasks_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>
    <ProjectTasks_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>8162</DeptId>
        <ProjId>11873</ProjId>
        <UserId>24661</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <ProjectTask>
        <TaskId>0</TaskId>
        <TaskTypeCode>ProjectTasks</TaskTypeCode>
        <Title>Create sample input data</Title>
        <MLSId>0</MLSId>
        <DateBegin i:nil="true"/>
        <DateEnd i:nil="true"/>
        <DateDue i:nil="true"/>
        <PctComplete>37</PctComplete>
        <EstHrs>12</EstHrs>
        <ActualHrs>0</ActualHrs>
        <EstCost>0</EstCost>
        <ActualCost>0</ActualCost>
        <OwnerUserId>0</OwnerUserId>
        <AssigneeUserId>24661</AssigneeUserId>
        <SortOrder>0</SortOrder>
        <DateOtherReminder i:nil="true"/>
        <TaskUnits>0</TaskUnits>
        <FirstRecurTaskId>0</FirstRecurTaskId>
        <FirstMeetingTaskId>0</FirstMeetingTaskId>
        <FolderId>0</FolderId>
        <DateCreated>0001-01-01T00:00:00</DateCreated>
        <DateUpdated>0001-01-01T00:00:00</DateUpdated>
        <FKId>0</FKId>
        <ImportId>0</ImportId>
        <NbrEvents>0</NbrEvents>
        <NbrFiles>0</NbrFiles>
        <NbrNotes>0</NbrNotes>
        <NbrTasks>0</NbrTasks>
        <OriginalId>0</OriginalId>
        <ProjId>0</ProjId>
        <ScheduledEventId>0</ScheduledEventId>
        <UpdateUserId>0</UpdateUserId>
        <ActStart i:nil="true"/>
        <ActFinish i:nil="true"/>
        <EstStart>2014-07-24T00:00:00</EstStart>
        <EstFinish>2014-07-25T00:00:00</EstFinish>
      </ProjectTask>
      <SendEmailAlert>Y</SendEmailAlert>
      <NewNotes>A note.</NewNotes>
    </ProjectTasks_Add>
  </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: 753 {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_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>8162</DeptId>
        <ProjId>11873</ProjId>
        <UserId>24661</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <ProjectTask>
        <TaskId>0</TaskId>
        <TaskTypeCode>ProjectTasks</TaskTypeCode>
        <Title>Create sample input data</Title>
        <MLSId>0</MLSId>
        <DateBegin i:nil="true"/>
        <DateEnd i:nil="true"/>
        <DateDue i:nil="true"/>
        <PctComplete>37</PctComplete>
        <EstHrs>12</EstHrs>
        <ActualHrs>0</ActualHrs>
        <EstCost>0</EstCost>
        <ActualCost>0</ActualCost>
        <OwnerUserId>0</OwnerUserId>
        <AssigneeUserId>24661</AssigneeUserId>
        <SortOrder>0</SortOrder>
        <DateOtherReminder i:nil="true"/>
        <TaskUnits>0</TaskUnits>
        <FirstRecurTaskId>0</FirstRecurTaskId>
        <FirstMeetingTaskId>0</FirstMeetingTaskId>
        <FolderId>0</FolderId>
        <DateCreated>0001-01-01T00:00:00</DateCreated>
        <DateUpdated>0001-01-01T00:00:00</DateUpdated>
        <FKId>0</FKId>
        <ImportId>0</ImportId>
        <NbrEvents>0</NbrEvents>
        <NbrFiles>0</NbrFiles>
        <NbrNotes>0</NbrNotes>
        <NbrTasks>0</NbrTasks>
        <OriginalId>0</OriginalId>
        <ProjId>0</ProjId>
        <ScheduledEventId>0</ScheduledEventId>
        <UpdateUserId>0</UpdateUserId>
        <ActStart i:nil="true"/>
        <ActFinish i:nil="true"/>
        <EstStart>2014-07-24T00:00:00</EstStart>
        <EstFinish>2014-07-25T00:00:00</EstFinish>
      </ProjectTask>
      <SendEmailAlert>Y</SendEmailAlert>
      <NewNotes>A note.</NewNotes>
    </ProjectTasks_Add>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

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

SOAP 1.2

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

See Also

ProjectTasks_Delete
ProjectTasks_Load
ProjectTasks_LoadByCriteria
ProjectTasks_Update
Agile Tasks Operations
SOAP API Reference

Highlight search results