Documentation

task.elapseditem.getlist

Returns a list of entries about elapsed time for a task.

Method Parameters

ParameterDescription
TASKID Task identifier. Required parameter.
ORDER Array for result sorting. Sorting field may take the following values:
  • ID – identifier of the entry about elapsed time;
  • USER_ID – identifier of the user on whose behalf the entry about the elapsed time was made;
  • MINUTES – elapsed time, minutes;
  • SECONDS – elapsed time, seconds ;
  • CREATED_DATE – entry creation date;
  • DATE_START – start date;
  • DATE_STOP – end date.
Sorting direction can take the following values:
  • asc – ascending;
  • desc – descending;
Optional. By default it is filtered by descending of the entry elapsed time identifier.
FILTER Array of the time {"filtered_field": "filter value" [, ...]}. Filtered field can take the following values:
  • ID – comment identifier;
  • USER_ID – identifier of the user on whose behalf the entry about the elapsed time was made;
  • CREATED_DATE – entry creation date.
Filtration type may be indicated before the name of the field to be filtered:
  • "!" – not equal;
  • "<" – less;
  • "<=" – less or equal;
  • ">" – more;
  • ">=" – more or equal.
filter values - a single value or an array.

Optional. By default entries are not filtered.
PARAMSArray for call options. The array NAV_PARAMS type {"call option": 'value' [, ...]} is the element that stores the following options:
  • nPageSize - number of elements per page. Record entries are limited to 50 to avoid excessive load on pagewise navigation.
  • iNumPage - page number within pagewise navigation.
SELECTArray of record fields to be returned by the method. Only the required fields can be specified. If the "*" value is available in the array - all available fields are returned.

Default value - empty array array(), meaning that all fields of the request table will be returned.

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

Please be advised on some specifics of manually adding information about worktime expended on the work completed several days ago. In this case, the following field values are changed:
  • CREATED_DATE - start date;
  • DATE_START - date entry created;
  • DATE_STOP - date entry created;

Example

// Obtaining all entries about elapsed time with sorting by descending ID.
// Only entries with fewer than 50 IDs will be filtered.

BX24.callMethod(
   'task.elapseditem.getlist',
   [1, {'ID': 'desc'}, {'<ID': 50}],
   function(result){
      console.info(result.data());
      console.log(result);
   }
);

Retrieving selection by the time spent based on the general filter conditions. For example, select data on working hours at the specified date:

BX24.callMethod(
  'task.elapseditem.getlist',
  [{'ID': 'desc'}, {'>=CREATED_DATE': '2018-02-16'}],
  function(result){
     console.info(result.data());
     console.log(result);
  }
);

Example of working with php:

// Example of working with php
// Obtain GET request for data selection.
$appParams = array(
    "auth" => '92006f4ae0c55d400f1e6e09428af64a',
    "ORDER" => array("ID" => "DESC"),            // Sorting by ID - descending 
    "FILTER" => array(">ID" => 1),                // Filter
    "SELECT" => array('ID', 'TASK_ID'),            // Selection - only record and task ID 
    "PARAMS" => array('NAV_PARAMS' => array(    // Pagewise navigation parameters
        "nPageSize" => 2,                        // per 2 items per page 
        'iNumPage' => 2                        // page number 2
    )),
);

$appRequestUrl = 'http://test-domain.ru/rest/task.elapseditem.getlist.xml?'.http_build_query($appParams);

print(urldecode($appRequestUrl));;


© «Bitrix24», 2001-2024