Get a List of Custom Fields task.item.userfield.getlist

Scope: task

Who can execute the method: any user

The method task.item.userfield.getlist retrieves a list of custom fields for tasks.

The list will include three system fields for linking to other objects:

  • UF_CRM_TASK — with CRM objects
  • UF_MAIL_MESSAGE — with the e-mail
  • UF_TASK_WEBDAV_FILES — with files from Drive

These fields are created based on custom fields, which is why they appear in the list. For more information about the relationships of tasks with other objects, refer to the article Tasks: Overview of Methods.

Method Parameters

Required parameters are marked with *

Name
type

Description

ORDER
object

Object for sorting the result in the format {"field": "sort value", ... }.

You can sort by the following fields:

  • ID — identifier of the custom field
  • FIELD_NAME — code of the custom field
  • USER_TYPE_ID — type of the custom field
  • SORT — sort value

The sort direction can take the following values:

  • asc — ascending
  • desc — descending

FILTER
object

Object for filtering the result in the format {"field": "filter value", ... }. The value of the filtered field can be a single value or an array of values.

You can filter by the following fields:

  • ID — identifier of the custom field
  • FIELD_NAME — code of the custom field
  • USER_TYPE_ID — type of the custom field
  • XML_ID — external identifier
  • MULTIPLE — multiple, Y or N
  • MANDATORY — mandatory, Y or N

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{
          "ORDER": {
            "SORT": "ASC"
          }
        }' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/task.item.userfield.getlist
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{
          "ORDER": {
            "SORT": "ASC"
          },
          "auth": "**put_access_token_here**"
        }' \
        https://**put_your_bitrix24_address**/rest/task.item.userfield.getlist
        
try
        {
            const response = await $b24.callMethod(
                'task.item.userfield.getlist',
                {
                    ORDER: {
                        SORT: 'ASC'
                    }
                }
            );
        
            const result = response.getData().result;
            console.log(result);
        }
        catch (error)
        {
            console.error(error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'task.item.userfield.getlist',
                    [
                        'ORDER' => [
                            'SORT' => 'ASC'
                        ]
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            print_r($result);
        } catch (Throwable $e) {
            echo $e->getMessage();
        }
        
BX24.callMethod(
            'task.item.userfield.getlist',
            {
                ORDER: {
                    SORT: 'ASC'
                },
            },
            function(result)
            {
                if (result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.log(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'task.item.userfield.getlist',
            [
                'ORDER' => [
                    'SORT' => 'ASC'
                ]
            ]
        );
        
        print_r($result);
        

Response Handling

HTTP Status: 200

{
            "result": [
                {
                    "ID": "1295",
                    "ENTITY_ID": "TASKS_TASK",
                    "FIELD_NAME": "UF_CRM_TASK",
                    "USER_TYPE_ID": "crm",
                    "XML_ID": "",
                    "SORT": "100",
                    "MULTIPLE": "Y",
                    "MANDATORY": "N",
                    "SHOW_FILTER": "N",
                    "SHOW_IN_LIST": "N",
                    "EDIT_IN_LIST": "N",
                    "IS_SEARCHABLE": "N",
                    "SETTINGS": {
                        "LEAD": "Y",
                        "CONTACT": "Y",
                        "COMPANY": "Y",
                        "DEAL": "Y"
                    }
                },
                {
                    "ID": "662",
                    "ENTITY_ID": "TASKS_TASK",
                    "FIELD_NAME": "UF_MAIL_MESSAGE",
                    "USER_TYPE_ID": "mail_message",
                    "XML_ID": "",
                    "SORT": "100",
                    "MULTIPLE": "N",
                    "MANDATORY": "N",
                    "SHOW_FILTER": "N",
                    "SHOW_IN_LIST": "N",
                    "EDIT_IN_LIST": "N",
                    "IS_SEARCHABLE": "N",
                    "SETTINGS": []
                },
                {
                    "ID": "229",
                    "ENTITY_ID": "TASKS_TASK",
                    "FIELD_NAME": "UF_TASK_WEBDAV_FILES",
                    "USER_TYPE_ID": "disk_file",
                    "XML_ID": "TASK_WEBDAV_FILES",
                    "SORT": "100",
                    "MULTIPLE": "Y",
                    "MANDATORY": "N",
                    "SHOW_FILTER": "N",
                    "SHOW_IN_LIST": "Y",
                    "EDIT_IN_LIST": "Y",
                    "IS_SEARCHABLE": "Y",
                    "SETTINGS": {
                        "IBLOCK_ID": 0,
                        "SECTION_ID": 0,
                        "UF_TO_SAVE_ALLOW_EDIT": ""
                    }
                },
                {
                    "ID": "1325",
                    "ENTITY_ID": "TASKS_TASK",
                    "FIELD_NAME": "UF_TASK_CLIENT_REQUEST",
                    "USER_TYPE_ID": "string",
                    "XML_ID": "UF_TASK_CLIENT_REQUEST",
                    "SORT": "220",
                    "MULTIPLE": "N",
                    "MANDATORY": "N",
                    "SHOW_FILTER": "N",
                    "SHOW_IN_LIST": "Y",
                    "EDIT_IN_LIST": "Y",
                    "IS_SEARCHABLE": "N",
                    "SETTINGS": {
                        "SIZE": 20,
                        "ROWS": 10,
                        "REGEXP": "",
                        "MIN_LENGTH": 0,
                        "MAX_LENGTH": 0,
                        "DEFAULT_VALUE": "Clarify the goal and expected outcome"
                    }
                },
                {
                    "ID": "1333",
                    "ENTITY_ID": "TASKS_TASK",
                    "FIELD_NAME": "UF_TASK_PROJECT_BUDGET",
                    "USER_TYPE_ID": "double",
                    "XML_ID": "UF_TASK_PROJECT_BUDGET",
                    "SORT": "230",
                    "MULTIPLE": "N",
                    "MANDATORY": "N",
                    "SHOW_FILTER": "N",
                    "SHOW_IN_LIST": "Y",
                    "EDIT_IN_LIST": "Y",
                    "IS_SEARCHABLE": "N",
                    "SETTINGS": {
                        "PRECISION": 0,
                        "SIZE": 20,
                        "MIN_VALUE": 0,
                        "MAX_VALUE": 0,
                        "DEFAULT_VALUE": 0
                    }
                },
                {
                    "ID": "1335",
                    "ENTITY_ID": "TASKS_TASK",
                    "FIELD_NAME": "UF_TASK_APPROVAL_DEADLINE",
                    "USER_TYPE_ID": "datetime",
                    "XML_ID": "UF_TASK_APPROVAL_DEADLINE",
                    "SORT": "240",
                    "MULTIPLE": "N",
                    "MANDATORY": "N",
                    "SHOW_FILTER": "N",
                    "SHOW_IN_LIST": "Y",
                    "EDIT_IN_LIST": "Y",
                    "IS_SEARCHABLE": "N",
                    "SETTINGS": {
                        "DEFAULT_VALUE": {
                            "TYPE": "NONE",
                            "VALUE": ""
                        },
                        "USE_SECOND": "Y",
                        "USE_TIMEZONE": "N"
                    }
                },
                {
                    "ID": "1337",
                    "ENTITY_ID": "TASKS_TASK",
                    "FIELD_NAME": "UF_TASK_LEGAL_REVIEW_REQUIRED",
                    "USER_TYPE_ID": "boolean",
                    "XML_ID": "UF_TASK_LEGAL_REVIEW_REQUIRED",
                    "SORT": "250",
                    "MULTIPLE": "N",
                    "MANDATORY": "N",
                    "SHOW_FILTER": "N",
                    "SHOW_IN_LIST": "Y",
                    "EDIT_IN_LIST": "Y",
                    "IS_SEARCHABLE": "N",
                    "SETTINGS": {
                        "DEFAULT_VALUE": 0,
                        "DISPLAY": "CHECKBOX",
                        "LABEL": ["", ""],
                        "LABEL_CHECKBOX": ""
                    }
                }
            ],
            "total": 0,
            "time": {
                "start": 1772718556,
                "finish": 1772718556.080225,
                "duration": 0.08022499084472656,
                "processing": 0,
                "date_start": "2026-03-05T16:49:16+01:00",
                "date_finish": "2026-03-05T16:49:16+01:00",
                "operating_reset_at": 1772719156,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
array

Array of custom field objects (detailed description)

total
integer

Currently returns 0

time
time

Information about the execution time of the request

Object result

Name
type

Description

ID
integer

Identifier of the custom field

ENTITY_ID
string

Code of the object to which the field is linked

FIELD_NAME
string

Code of the custom field

USER_TYPE_ID
string

Data type

XML_ID
string

External identifier

SORT
integer

Sort value

MULTIPLE
char

Indicates multiple values. Possible values:

  • Y — multiple
  • N — single

MANDATORY
char

Indicates mandatory field. Possible values:

  • Y — mandatory
  • N — optional

SHOW_FILTER
char

Display in the list filter

SHOW_IN_LIST
char

Display in the list

EDIT_IN_LIST
char

Editing allowed in the list

IS_SEARCHABLE
char

Value is searchable

SETTINGS
object

Additional settings for the field, composition depends on the type USER_TYPE_ID

Error Handling

Name
type

Description

error
string

String error code. It may consist of digits, Latin letters, and underscores

error_description
error_description

Textual description of the error. The description is not intended to be shown to the end user in its raw form

Statuses and System Error Codes

HTTP Status: 20x, 40x, 50x

The errors described below may occur when calling any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

405

ERROR_BATCH_METHOD_NOT_ALLOWED
Method is not allowed for batch usage

The current method is not allowed to be called using batch

400

ERROR_BATCH_LENGTH_EXCEEDED
Max batch length exceeded

The maximum length of parameters passed to the batch method has been exceeded

401

NO_AUTH_FOUND
Wrong authorization data

Invalid access token or webhook code

400

INVALID_REQUEST
Https required

The methods must be called using the HTTPS protocol

503

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support

403

ACCESS_DENIED
REST API is available only on commercial plans

The REST API is available only on commercial plans

403

INVALID_CREDENTIALS
Invalid request credentials

The user whose access token or webhook was used to call the method lacks permissions

404

ERROR_MANIFEST_IS_NOT_AVAILABLE
Manifest is not available

The manifest is not available

403

insufficient_scope
The request requires higher privileges than provided by the webhook token

The request requires higher privileges than those provided by the webhook token

401

expired_token
The access token provided has expired

The provided access token has expired

403

user_access_error
The user does not have access to the application

The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users

500

PORTAL_DELETED
Portal was deleted

The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site

Continue Learning