Documentation

add

\CTaskCommentItem::add(\CTaskItem $task, array $fields);

Static method for creating a task comment.

Parameters

First parameter passes a task object, second - comment fields.

ParameterDescriptionVersion
AUTHOR_ID  User ID who created a comment.
AUTHOR_NAME  user name (optional).
AUTHOR_EMAIL  User e-mail (optional).
USE_SMILES  (Y|N) - to parse or no the comments for smileys.
POST_MESSAGE  Message text.
FILES  Array of file.
AUX (Y|N) - update statistics module and send message about new recipient message.

Example


$task = \CTaskItem::getInstance($this->entityId, $authorId);
\CTaskCommentItem::add($task, $fields);

Example of use in REST

http://site.bx/rest/1/SECRETKEY/tasks.task.comments.add?taskId=1&fields[POST_MESSAGE]=hello%20world!

Comment creating event can be subscribed to:

RegisterModuleDependences('forum', 'OnCommentTopicAdd', 'tasks', 'YourClass', 'onBeforeAdd');

RegisterModuleDependences('forum', 'OnAfterCommentTopicAdd', 'tasks', 'YourClass', 'onAfterAdd');


© «Bitrix24», 2001-2024
Up