Получить список задач task.item.list
Выберите инструмент для разработки с AI-агентом:
- используйте Битрикс24 Вайбкод, чтобы создать приложение для Битрикс24 по описанию задачи без знания языков программирования. Агент напишет код и разместит приложение на сервере без ручной настройки хостинга
- используйте MCP-сервер, чтобы разрабатывать интеграцию через REST API в своем проекте. Агент будет обращаться к официальной REST-документации
Scope:
taskКто может выполнять метод: любой пользователь
Метод task.item.list возвращает массив задач, каждая из которых содержит массив полей (аналогичен массиву, возвращаемому task.item.getdata).
DEPRECATED
Развитие метода остановлено. Используйте tasks.task.list.
Параметры метода
|
Название |
Описание |
|
ORDER |
Массив вида
Направление сортировки может принимать значения:
Необязательный параметр. По умолчанию фильтруется по убыванию идентификатора задачи |
|
FILTER |
Массив вида
Перед названием фильтруемого поля может указать тип фильтрации:
Значения фильтра — одиночное значение или массив. Необязательный параметр. По умолчанию записи не фильтруются. Для метода |
|
PARAMS |
Массив для опций вызова. Элементом является массив
|
|
SELECT |
Массив полей записей, которые будут возвращены методом. Если в массиве присутствует значение Значение по умолчанию (пустой массив |
Соблюдение порядка следования параметров в запросе обязательно. При его нарушении запрос будет выполнен с ошибками.
Однако, если какие-то параметры нужно пропустить, то их все равно нужно передать, но в виде пустых массивов: ORDER[]=&FILTER[]=&PARAMS[]=&SELECT[]=.
Примеры кода
Как использовать примеры в документации
Получить список всех задач (по умолчанию сработает ограничение — постраничная навигация по 50 элементов).
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/task.item.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{}' \
https://**put_your_bitrix24_address**/rest/task.item.list?auth=**put_access_token_here**
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of the payload returned in result (each task is a map of field values)
type TaskItemListResult = Record<string, unknown>[]
try {
// task.item.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make<TaskItemListResult>({
method: 'task.item.list',
params: {},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Tasks fetched:', result.length)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function fetchTaskList() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
// task.item.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make({
method: 'task.item.list',
params: {},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Tasks fetched:', result.length)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', fetchTaskList)
</script>
try {
$response = $b24Service
->core
->call(
'task.item.list',
[]
);
$result = $response
->getResponseData()
->getResult();
echo 'Data: ' . print_r($result, true);
echo 'Full Result: ' . print_r($response, true);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error fetching task list: ' . $e->getMessage();
}
BX24.callMethod(
'task.item.list',
[],
function(result)
{
console.info(result.data());
console.log(result);
}
);
require_once('crest.php');
$result = CRest::call(
'task.item.list',
[]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "task.item.list", nil, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("task.item.list: %w", err)
}
// Ответ приходит как json.RawMessage — разберите его
// в структуру под форму ответа, показанную ниже на этой странице.
fmt.Printf("%s\n", res.Result)
Получить список задач с идентификаторами 1, 2, 3, 4, 5, 6, причем выбрать только поля ID и TITLE. Режим постраничной навигации — по 2 элемента на странице, 2-ая страница. Сортировка по ID — по убыванию.
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"order":{"ID":"desc"},"filter":{"ID":[1,2,3,4,5,6]},"params":{"NAV_PARAMS":{"nPageSize":2,"iNumPage":2}}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/task.item.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"order":{"ID":"desc"},"filter":{"ID":[1,2,3,4,5,6]},"params":{"NAV_PARAMS":{"nPageSize":2,"iNumPage":2}},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/task.item.list
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of the payload returned in result (each task is a map of field values)
type TaskItemListResult = Record<string, unknown>[]
try {
// task.item.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make<TaskItemListResult>({
method: 'task.item.list',
params: {
order: { ID: 'desc' },
filter: { ID: [1, 2, 3, 4, 5, 6] },
params: {
NAV_PARAMS: {
nPageSize: 2,
iNumPage: 2,
},
},
},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Tasks on page:', result.length)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function fetchFilteredTaskList() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
// task.item.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make({
method: 'task.item.list',
params: {
order: { ID: 'desc' },
filter: { ID: [1, 2, 3, 4, 5, 6] },
params: {
NAV_PARAMS: {
nPageSize: 2,
iNumPage: 2,
},
},
},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Tasks on page:', result.length)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', fetchFilteredTaskList)
</script>
try {
$response = $b24Service
->core
->call(
'task.item.list',
[
['ID' => 'desc'], // Сортировка по ID — по убыванию.
['ID' => [1, 2, 3, 4, 5, 6]], // Фильтр
[
'NAV_PARAMS' => [ // постраничка
'nPageSize' => 2, // по 2 элемента на странице.
'iNumPage' => 2 // страница номер 2
]
]
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
// Нужная вам логика обработки данных
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error fetching task list: ' . $e->getMessage();
}
BX24.callMethod(
'task.item.list',
[
{ID : 'desc'}, // Сортировка по ID — по убыванию.
{ID: [1,2,3,4,5,6]}, // Фильтр
{
NAV_PARAMS: { // постраничка
nPageSize : 2, // по 2 элемента на странице.
iNumPage : 2 // страница номер 2
}
}
],
function(result)
{
console.info(result.data());
console.log(result);
}
);
require_once('crest.php');
$result = CRest::call(
'task.item.list',
[
'order' => ['ID' => 'desc'],
'filter' => ['ID' => [1, 2, 3, 4, 5, 6]],
'params' => [
'NAV_PARAMS' => [
'nPageSize' => 2,
'iNumPage' => 2
]
]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "task.item.list", b24.Params{
"ORDER": b24.Params{
"ID": "desc",
},
"FILTER": b24.Params{
"ID": []int{1, 2, 3, 4, 5, 6},
},
"PARAMS": b24.Params{
"NAV_PARAMS": b24.Params{
"nPageSize": 2,
"iNumPage": 2,
},
},
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("task.item.list: %w", err)
}
// Ответ приходит как json.RawMessage — разберите его
// в структуру под форму ответа, показанную ниже на этой странице.
fmt.Printf("%s\n", res.Result)