Skip to main content

Add custom task field

Adds a new custom field to be added to the task

Function AddCustomTaskField(Val URL, Val Type, Val Name, Val ExternalID = "", Val Title = "", Val Signature = "", Val Token = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringURL of webhook or a Bitrix24 domain, when token used
Type--typeStringField type: string, double, date, boolean
Name--fieldnameStringText identifier (name) of the field
ExternalID--externalidStringText identifier for external integration
Title--titleStringField title
Signature--labelStructure of KeyAndValueForm label. Key: en or ru, Value: Lable text
Token--tokenStringAccess token, when app auth method used

Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API


tip

Method at API documentation: task.item.userfield.add


1C:Enterprise/OneScript code example
    URL = "https://b24-ar17wx.bitrix24.by/rest/1/yg2...";

Type = "date";
Name = "BIRTHDAY_FIELD";

Result = OPI_Bitrix24.AddCustomTaskField(URL, Type, Name);

URL = "b24-ar17wx.bitrix24.by";
Token = "2f4e4067006e9f06006b12e400000001000...";

Type = "string";
Name = "TEXT_FIELD";
ExternalID = "BITRIX_TEXT_FIELD";
Title = "Text field";
Signature = New Structure("en,ru", "Some field", "Nekotoroe pole");

Result = OPI_Bitrix24.AddCustomTaskField(URL, Type, Name, ExternalID, Title, Signature, Token);
    # JSON data can also be passed as a path to a .json file

oint bitrix24 AddCustomTaskField \
--url "b24-ar17wx.bitrix24.by" \
--fieldid 261 \
--externalid "NEW_TEXT_FIELD" \
--label "{'en':'Updated field','ru':'Izmenennoe pole'}" \
--token "***"
Result
{
"result": 261,
"time": {
"start": 1722114794.52732,
"finish": 1722114794.59725,
"duration": 0.0699310302734375,
"processing": 0.0470340251922607,
"date_start": "2024-07-27T21:13:14+00:00",
"date_finish": "2024-07-27T21:13:14+00:00",
"operating_reset_at": 1722115394,
"operating": 0
}
}