Planfix API task.add

From Planfix
Jump to: navigation, search

This feature lets you create a new task. Request format:

<?xml version="1.0" encoding="UTF-8"?>
<request method="task.add">
  <account></account>
  <sid></sid>
  <task>
    <template></template>
    <title></title>
    <description></description>
    <importance></importance>
    <status></status>
    <statusSet></statusSet>
    <checkResult></checkResult>
    <owner>
      <id></id>
    </owner>
    <parent>
      <id></id>
    </parent>
    <project>
      <id></id>
    </project>
    <client>
      <id></id>
    </client>
    <beginDateTime></beginDateTime>
    <startDateIsSet></startDateIsSet>
    <startDate></startDate>
    <startTimeIsSet></startTimeIsSet>
    <startTime></startTime>
    <endDateIsSet></endDateIsSet>
    <endDate></endDate>
    <endTimeIsSet></endTimeIsSet>
    <endTime></endTime>
    <isSummary></isSummary>
    <duration></duration>
    <durationUnit></durationUnit>
    <durationIsSet></durationIsSet>
    <workers>
      <users>
        <id></id>
        <id></id>
        <!-- ... -->
      </users>
      <groups>
        <id></id>
        <id></id>
        <!-- ... -->
      </groups>
    </workers>    
    <members>
      <users>
        <id></id>
        <id></id>
        <!-- ... -->
      </users>
      <groups>
        <id></id>
        <id></id>
        <!-- ... -->
      </groups>
    </members>      
    <auditors>
      <users>
        <id></id>
        <id></id>
        <!-- ... -->
      </users>
      <groups>
        <id></id>
        <id></id>
        <!-- ... -->
      </groups>
    </auditors>
    <customData>
      <customValue>
        <id></id>
        <value></value>
      </customValue>
      <!-- ... -->
    </customData>
  </task>
  <signature></signature>
</request>
Name Type Value Notes
template id task template ID id in response from task.getList with target = template
Creating a task based on a template using the API is currently incomplete. 

The layout from the template is applied (and, accordingly, any custom fields in the task) and some of its properties. 

Currently, the following are not set from the template: task dates, auditors, data tags, files, reminders, checklists. Assignees and participants are set from the template if they're missing in the request.

title string task name
description string what the task is about; description
importance enum priority for a list of valid values, see the task priority section
status enum/int task status Valid values can be found in the System task statuses section; or status IDs received as a result of calling the TaskStatus.getListOfSet function
statusSet int     task process Process IDs can be retrieved by calling the TaskStatus.getSetList function
checkResult bool whether or not the task has mandatory result checking
owner task creator not required. If not specified, the user who executes the function will be used
owner.id int user identifier if this is a contact, you must use the userid in the response from   contact.get
parent parent task not required
parent.id int identifier of the task that will be the parent task value 0 (zero) allowed
project the project in which the task should be placed  
project.id int project identifier
client counterparty not required
client.id int counterparty identifier value 0 is allowed
beginDateTime DateTime date/time of creation; not required; by default current date/time is used can only be used if an employee with admin rights is logged in
startDateIsSet bool (0/1) whether or not a start date is set  
startDate Date start date the get started field in the Planfix interface
startTimeIsSet bool (0/1) whether or not a start time is set  
startTime Time start time the get started field in the Planfix interface
endDateIsSet bool (0/1) whether or not an end date is set  
endDate Date end date the finish before field in the Planfix interface
endTimeIsSet bool (0/1) whether or not an end time is set  
endTime Time end time the finish before field in the Planfix interface
isSummary bool (0/1) task is a summary task  
durationIsSet bool whether or not a duration is set  
duration int duration  
durationUnit int 0 - minutes; 1 - hours; 2 - days  
workers root element of the list of task assignees
workers.users root element of the list of users to whom the task is assigned
workers.users.id int identifier of the user to whom the task is assigned for contacts, you must use the userid in the response from contact.get
workers.groups root element of the list of groups to whom the task is assigned
workers.groups.id int group identifier
members     root element of the list of task participants
members.users root element of the list of task participants
members.users.id int identifier of a task participant for contacts, you must use the userid in the response from contact.get
members.groups root element of the list of participant groups
members.groups.id int participant group identifier
auditors root element of the list of task auditors; the same as assignees and members
customData values of task custom fields
customData.customValue.id task custom field identifier
customData.customValue.value custom task field value (for task set, employee list, and directory entry set field types, separate identifiers with commas in square brackets)

Dates may be added in one of two formats. First is the short format, which specifies only a date, year, and month. Second is the long format, which also specifies start/end time, if required for the task.


Response when operation is successfully executed:

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
  <task>
    <id></id>
    <general></general>
  </task>
</response>
Name Type Value Notes 
task.id int ID of the task created
task.general int  passthrough number of the created task


Otherwise, an error response will be returned:

<?xml version="1.0" encoding="UTF-8"?>
<response status="error">
  <code></code>
</response>


Go To