task.checklistitem.add
Adds a new checklist element to a task. Returns ID of the added element. This method doesn't add task permissions to user specified in the FIELDS
array, as it's done via the Bitrix24 interface. If this user didn't have permissions for viewing, this user's appearance in checklist in any role - won't make task available.
Parameters
Parameter | Description |
---|---|
TASKID | Task ID. Required parameter. |
FIELDS | Array of fields of a checklist element (TITLE, SORT_INDEX, IS_COMPLETE). Required parameter. |
Attention! Compliance to parameter sequence in the request is mandatory. If sequence is not observed, the request will be completed with errors.
Example
// Adding a new 'completed' checklist element with the text 'Item completed' to the task with ID=13. BX24.callMethod( 'task.checklistitem.add', [13, {'TITLE': 'Item completed', 'IS_COMPLETE': 'Y'}], function(result){ console.info(result.data()); console.log(result); } );
To add a user to checklist item:
$fields = [ 'TITLE' => "User Name item title",//$user['NAME']." ".$user['LAST_NAME'], with sequence depending on account settings. 'IS_COMPLETE' => 'N', 'IS_IMPORTANT' => 'N', 'MEMBERS' => [13 => ['TYPE' => 'A']], //TYPE - role_in_checklist: A - participant, U - observer 'PARENT_ID' => '$result[0]' // for call in batch, otherwise just the ID of parent item ];
© «Bitrix24», 2001-2024