Documentation

task.item.list

Attention! This method is deprecated and is no longer supported. It is recommended to use the methods tasks.task.*.

Returns an array of tasks, each of which contains a fields array (similar to the array, returned by task.item.getdata).

Function parameters

ParameterDescription
ORDERArray for result sorting. Array type {"sorting_field": 'sorting direction' [, ...]}.
Field for sorting can have the following values:
  • TITLE - task title;
  • DATE_START - start date;
  • DEADLINE - deadline;
  • STATUS - status;
  • PRIORITY - priority;
  • MARK - mark;
  • CREATED_BY - user, who created the task;
  • RESPONSIBLE_ID - user, responsible for the task;
  • GROUP_ID - workgroup;
Sorting direction can have values:
  • asc - by ascension;
  • desc - by descension;
 Optional. By default, it is filtered by descension of task ID.
FILTERArray type {"filtered_field": "filter value" [, ...]}. Filtered field can have values:
  • ID - task ID;
  • PARENT_ID - parent task ID;
  • GROUP_ID - workgroup ID;
  • CREATED_BY - user, who created the task;
  • STATUS_CHANGED_BY - user, who was the last to modify task status;
  • PRIORITY - priority;
  • FORUM_TOPIC_ID - forum topic ID;
  • RESPONSIBLE_ID - responsible;
  • TITLE - task name (can be searched by template [%_]) ;
  • TAG -  tag;
  • REAL_STATUS - task status. Constants that display tasks statuses:
    • STATE_NEW = 1;
    • STATE_PENDING = 2;
    • STATE_IN_PROGRESS = 3;
    • STATE_SUPPOSEDLY_COMPLETED = 4;
    • STATE_COMPLETED = 5;
    • STATE_DEFERRED = 6;
    • STATE_DECLINED = 7;
  • STATUS - Status for sorting. Similar to REAL_STATUS, but additionally has two meta statuses:
    • -2 - not overdue task;
    • -1 - overdue task.
  • MARK - mark;
  • SITE_ID - site ID;
  • ADD_IN_REPORT - task in report (Y|N);
  • DATE_START - date when task completion was started;
  • DEADLINE - deadline;
  • CREATED_DATE - date when created;
  • CLOSED_DATE - date when completed;
  • CHANGED_DATE - date when last modified;
  • ACCOMPLICE - participant ID;
  • AUDITOR - auditor ID;
  • DEPENDS_ON - preceding task ID; 
  • ONLY_ROOT_TASKS -  only tasks, which are not subtasks (root tasks), as well as subtasks of parent task. Current user does not have access to this parent tasks (Y|N).
The following types of filtration can be specified in front of the name of filtered field:
  • "!" - not equal
  • "<" - less
  • "<=" - less or equal
  • ">" - more
  • ">=" - more or equal

"filter values" - single value or an array.

Optional. By default, records are not filtered.

Attention! For the task.item.list method, it is mandatory to specify sorting for filtration. Filtration without sorting returns all tasks.

PARAMSArray for the call options. Element is the NAV_PARAMS array type {"call options": 'value' [, ...]}, that stores the following options:
  • nPageSize - quantity of elements on a page. To limit the load, page-by-page navigation is restricted to 50 tasks.
  • iNumPage - page number in page-by-page navigation.
SELECTArray of record fields, which will be returned by the method. Only those fields can be specified that are required. If "*" value is present in the array, then all available fields will be returned.

By default value - empty array array() - signifies that all fields of main table in the request will be returned.

Attention! Compliance to parameter sequence in the query is mandatory. If sequence is not observed, the request will be executed with errors.



However, if certain parameters must be left out, they still must be passed, but as empty arrays: ORDER[]=&FILTER[]=&PARAMS[]=&SELECT[]=.

Example

// Example of working with JavaScript
// We will receive the list of all tasks (by default, restriction will be triggered — only 50 element per page)
BX24.callMethod(
	'task.item.list',
	[],
	function(result)
	{
		console.info(result.data());
		console.log(result);
	}
);
// Example of working with JavaScript
// We will receive list of tasks with the following IDs: 1,2,3,4,5,6. Select only ID and TITLE fields.
// Per page restriction mode — per 2 elements on a page, 2nd page.
// Sorting by ID — by descension.
BX24.callMethod(
	'task.item.list',
	[
		{ID : 'desc'},		// Sorting by ID — by descension.
		{ID: [1,2,3,4,5,6]},	// Filter
		{	
            NAV_PARAMS: { // per page
		        nPageSize : 2,	// per 2 elements on a page.
		        iNumPage  : 2	// page No. 2        
			}
		}
	],
	function(result)
	{
		console.info(result.data());
		console.log(result);
	}
);
// Example of working with php
// Receiving GET-request for data selection.
$appParams = array(
     "auth" => '92006f4ae0c55d400f1e6e09428af64a',
     "ORDER" => array("DEADLINE" => "desc"),
     "FILTER" => array(">ID" => 1),
     "PARAMS" => array('NAV_PARAMS' => array("nPageSize" => 2, 'iNumPage' => 2)),
);

$appRequestUrl = 'http://test-domain.com/rest/task.item.list.xml?'.http_build_query($appParams);

print(urldecode($appRequestUrl));;

Method passes tags, if it receives LOAD_TAGS parameter:

/rest/task.item.list.xml?auth=31r0ckfy3r2u96yttz4k70g5kv2w534h&O[]=&F[]=&P[LOAD_TAGS]=Y


© «Bitrix24», 2001-2024