Documentation

Frequently asked questions

Solutions for several frequent questions regarding tasks.



How to get filtered list of tasks via http query?

Task filters by ID, date, status. Its recommended to tasks.task.get for the filter '=ID' => 3 because it doesn't have pagewise navigation.

$filter = [];

//by id
$filter = [
    '>ID' => 3
];

$filter = [
    '=ID' => 3//recommend: CRest::call('tasks.task.get');
];


//by date
$filter = [
    '<CREATED_DATE' => date(DATE_ATOM, mktime(12, 22, 37, 7, 25, 2019))
];

//by status
$filter = [
    '>STATUS' => 2 // 2 is enum value. for current client: CRest::call( 'tasks.task.getFields');
];


$result = CRest::call(
    'tasks.task.list',
    [
        'filter' => $filter,
        'select' => [
            'ID',
            'TITLE',
            'CREATED_DATE'
        ]
    ]
);

//all fields
$fields = CRest::call( 'tasks.task.getFields');

echo '<pre>';
print_r([$filter, $result, $fields]);
echo '</pre>';



$result = CRest::call(
    'tasks.task.get',
    [
        'taskId' => 3,
        'select' => [
            'ID',
            'TITLE',
            'CREATED_DATE'
        ]
    ]
);
echo '<pre>';
print_r($result);
echo '</pre>';


User Comments

User comments are not part of official documentation. Use information provided by other users in the comments at your own risk.

The User Comments section is not to be used as a feature discussion board. Only registered users can post comments. Your comment will be visible once it has been approved by the moderator.
© «Bitrix24», 2001-2021