• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/scrum/controllers/epic.php
  • Класс: BitrixTasksScrumControllersEpic
  • Вызов: Epic::getEpicAction
public function getEpicAction(int $epicId): ?array
{
	$userId = UtilUser::getId();

	$epicService = new EpicService();

	$epic = $epicService->getEpic($epicId);
	if (!$epic->getId())
	{
		$this->errorCollection->setError(
			new Error(Loc::getMessage('TASKS_EC_ERROR_COULD_NOT_READ_EPIC'))
		);

		return null;
	}

	if (!Group::canReadGroupTasks($userId, $epic->getGroupId()))
	{
		$this->errorCollection->setError(
			new Error(
				Loc::getMessage('TASKS_EC_ERROR_ACCESS_DENIED'),
				self::ERROR_ACCESS_DENIED
			)
		);

		return null;
	}

	$description = (new CBXSanitizer)->sanitizeHtml($epic->getDescription());

	$userFields = $epicService->getFilesUserField($this->userFieldManager, $epicId);
	if ($epicService->getErrors())
	{
		$this->errorCollection->add($epicService->getErrors());

		return null;
	}

	$taskService = new TaskService($userId);
	$outDescription = $taskService->convertDescription($description, $userFields);
	if ($taskService->getErrors())
	{
		$this->errorCollection->add($taskService->getErrors());

		return null;
	}

	$epic->setDescription($outDescription);

	return $epic->toArray();
}