• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/rest/controllers/viewedgroup/scrum.php
  • Класс: BitrixTasksRestControllersViewedGroupScrum
  • Вызов: Scrum::markAsReadAction
public function markAsReadAction($fields): ?bool
{
	$fields['GROUP_ID'] = ($fields['GROUP_ID'] ?? null);
	$fields['ROLE'] = ($fields['ROLE'] ?? null);

	if (CommentsViewedGroup::isOn())
	{
		$r = (new CommentsViewedGroup())->markAsRead(
			$fields['GROUP_ID'],
			CommentsViewedGroup::ROLE_ALL,
			CommentsViewedEnum::resolveTypeById(CommentsViewedEnum::SCRUM)
		);

		if ($r->isSuccess() === false)
		{
			$this->addErrors($r->getErrors());
			return null;
		}

		$params = CommentsViewedEvent::prepare($fields);
		CommentsViewedEvent::addByTypeCounterService(CommentsViewedEnum::SCRUM,  $params);
		CommentsViewedEvent::addByTypePushService(CommentsViewedEnum::SCRUM, $params);

		return true;
	}

	return $this->forward(new Comment(), 'readScrum', ['groupId' => $fields['GROUP_ID']]);
}