Returns an array of tasks, each of which contains an array of fields (similar to the array returned by task.item.getdata).
Parameters
Parameter | Description |
ORDER | Sorting array. Array of the {"Sort_field": 'sort order' [, ...]} type.
The Sort field may have the following values:
- TITLE - Task name;
- DATE_START - Start date;
- DEADLINE - Deadline;
- STATUS - Status;
- PRIORITY - Priority;
- MARK - Rating;
- CREATED_BY - Creator;
- RESPONSIBLE_ID - Person responsible;
- GROUP_ID - Workgroup.
Sort order may have the following values:
- asc - ascending;
- desc - descending;
Not required. By default is filtered in descending order of task IDs.
Note. May be sorted by user fields.
|
FILTER | Array of the {"filtered_field": "filter value" [, ...]} type. Filtered field may have the following values:
- ID - Task ID;
- PARENT_ID - Parent task ID;
- GROUP_ID - Workgroup ID;
- CREATED_BY - Creator;
- STATUS_CHANGED_BY - User who modified task status last;
- PRIORITY - Priority;
- FORUM_TOPIC_ID - Forum topic ID;
- RESPONSIBLE_ID - Person responsible;
- TITLE - Task name (May be searched by [%_] template) ;
- TAG - Tag;
- REAL_STATUS - Task status. Constants corresponding to task status:
- STATE_NEW = 1;
- STATE_PENDING = 2;
- STATE_IN_PROGRESS = 3;
- STATE_SUPPOSEDLY_COMPLETED = 4;
- STATE_COMPLETED = 5;
- STATE_DEFERRED = 6;
- STATE_DECLINED = 7;
- STATUS - Sorting status. Similar to REAL_STATUS, but has two additional meta status:
- -2 - Overdue task;
- -1 - Newly created task.
- MARK - Rating;
- XML_ID - External code;
- SITE_ID - Website ID;
- ADD_IN_REPORT - Add task to report (Y|N);
- DATE_START - Start date;
- DEADLINE - Deadline;
- CREATED_DATE - Date created;
- CLOSED_DATE - Date closed;
- CHANGED_DATE - Date last modified;
- ACCOMPLICE - Participant ID;
- AUDITOR - Observer ID;
- DEPENDS_ON - Previous task ID;
- ONLY_ROOT_TASKS - Root tasks only (Y|N);
- SUBORDINATE_TASKS - Current user's and subordinates' tasks (Y|N);
- OVERDUED - Were overdue (Y|N);
- DEPARTMENT_ID - Department ID.
Filter type may be specified before filtered field name:
- "!" - not equal to
- "<" - less than
- "<=" - less than or equal to
- ">" - greater than
- ">=" - greater than or equal to
"filter value" - single value or array.
Not required. Records are not filtered by default.
|
TASKDATA | Array of returned task fields. |
NAV_PARAMS | Page-by-page navigation. The following options are available:
- nPageSize - Number of elements on a page,
- iNumPage - Page number.
|
Example
// Get a list of all tasks (by default - a limit of 50 elements per page)
BX24.callMethod(
'task.items.getlist',
[],
function(result){
console.info(result.data());
console.log(result);
}
);
// Get a list of tasks with IDs: 1,2,3,4,5,6, where only ID and TITLE fields are selected.
// Per page mode is 2 elements per page, 2nd page.
// Sort by ID in descending order.
BX24.callMethod(
'task.items.getlist',
[
{ID : 'desc'}, // Sort by ID in descending order.
{ID: [1,2,3,4,5,6]}, // Filter
['ID', 'TITLE'], // Selected fields
{
NAV_PARAMS: { // per page
nPageSize : 2, // 2 elements per page
iNumPage : 2 // page number 2
}
}
],
function(result){
console.info(result.data());
console.log(result);
}
);
Note: To limit the load on page-by-page navigation there is a limit of 50 tasks.