Add Task

This command is used to add a task to WHMCSPM2

Attributes

name - task name
description - task description
assigned - id of admin task is assigned to (single admin)
private - (boolean) internal project, client cannot view
admin_email_ok - (boolean) enable admin notifications for project
client_email_ok - (boolean) enable client notifications for project
complete - (integer) percent complete in whole number
projectid - projectid of the project the task is for
category - category id
priority - priority id
status - status id
segment - (integer) percent of total project this task represents
startdate - start date of the project, default is today (whmcs date format)
enddate - end date or deadline of the project, default is today (whmcs date format)
creatortype -  (1 for admin,2 for client) default is 1 for admin
creator - client id or admin id
billableitemid - id from tblproducts, or custom for custom values
billablerate - in the format 222.22, (requires custom billable item)
billabledescription - description of custom billable item
calendar - (boolean) add calendar entry for this task
sendemail - (boolean) Send Client and Admin email notifications?
customfields - a base64 encoded serialized array of custom field values
**NOTE** For boolean values, use 0 for false and 1 for true;

Example Command

$postfields["action"] = "whmcspm2addtask";
$postfields["name"] = "Sample API created task";
$postfields["description"] = "This is a description";
$postfields["assigned"] = "1";
$postfields["private"] = "0";
$postfields["admin_email_ok"] = "1";
$postfields["client_email_ok"] = "1";
$postfields["complete"] = "27";  // represents 27%
$postfields["projectid"] = "4";
$postfields["category"] = "1";
$postfields["priority"] = "1";
$postfields["status"] = "2";
$postfields["segment"] = "25"; // represents 25%
$postfields["startdate"] = "2011-11-03";
$postfields["enddate"] = "2012-01-22";
$postfields["creatortype"] = "1";
$postfields["creator"] = "4";
$postfields["billableitemid"] = "custom";
$postfields["billablerate"] = "45.00"; // represents $45.00
$postfields["billabledescription"] = "Web Development / Hour";
$postfields["calendar"] = "1";
$postfields["sendemail"] = "0";
$customfields = array("22" => "A CF Value","18" => "Some Other CF Value");
$postfields["customfields"] = base64_encode(serialize($customfields));

Returned Variables

result - error / success
taskid - the task id that was just created
Was this answer helpful? 0 Users Found This Useful (0 Votes)