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
Parameter | Description |
---|---|
ORDER | Array for result sorting. Array type {"sorting_field": 'sorting direction' [, ...]}.
Field for sorting can have the following values:
|
FILTER | Array type {"filtered_field": "filter value" [, ...]}. Filtered field can have values:
"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.
|
PARAMS | Array for the call options. Element is the NAV_PARAMS array type {"call options": 'value' [, ...]}, that stores the following options:
|
SELECT | Array 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