• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/rest/controllers/scrum/epic.php
  • Класс: BitrixTasksRestControllersScrumEpic
  • Вызов: Epic::getAction
public function getAction(int $id)
{
	global $USER_FIELD_MANAGER;

	$id = (int) $id;
	if (!$id)
	{
		$this->errorCollection->add([new Error('Epic not found')]);

		return null;
	}

	$epicService = new EpicService();

	$epic = $epicService->getEpic($id);
	if (!$epic->getId())
	{
		$this->errorCollection->add([new Error('Epic not found')]);
		return null;
	}
	if (!$this->checkAccess($epic->getGroupId()))
	{
		$this->errorCollection->add([new Error('Access denied')]);
		return null;
	}

	$userFields = $epicService->getFilesUserField($USER_FIELD_MANAGER, $epic->getId());
	if ($epicService->getErrors())
	{
		$this->errorCollection->add($epicService->getErrors());

		return null;
	}

	$result = $epic->toArray();
	$result['files'] = $userFields['UF_SCRUM_EPIC_FILES'];

	return $result;
}