$listActivity = CCrmActivity::GetList(
$arOrder = [],
$arFilter = [
'OWNER_ID' => $dealId, // ID сделки
'OWNER_TYPE_ID' => 2, // 1-Лид, 2-Сделка, 3-Контакт, 4-Компания
'TYPE_ID' => 3, // 1-Встреча, 2-Звонок, 3-Задача, 4-Email
'COMPLETED' => 'N'
],
$arGroupBy = false,
$arNavStartParams = false,
$arSelectFields = [],
$arOptions = [
'CURRENT_USER' => 1
]
);
while ($activity = $listActivity->Fetch()) {
$arActivity[] = $activity;
}