• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/checklistitem.php
  • Класс: CTaskCheckListItem
  • Вызов: CTaskCheckListItem::getNextSortIndex
static function getNextSortIndex($items, $parentId)
{
	$neighbours = array_filter(
		$items,
		static function ($item) use ($parentId)
		{
			return (int)$item['PARENT_ID'] === $parentId;
		}
	);
	$sortIndexes = array_column($neighbours, 'SORT_INDEX');

	return (empty($sortIndexes) ? 0 : (int)max($sortIndexes)) + 1;
}