---
sidebar_position: 2
description: Add custom task field and other functions to work with Bitrix24 in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Bitrix24]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# 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`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | URL | --url | String | &#x2714; | URL of webhook or a Bitrix24 domain, when token used |
  | Type | --type | String | &#x2714; | Field type: string, double, date, boolean |
  | Name | --fieldname | String | &#x2714; | Text identifier (name) of the field |
  | ExternalID | --externalid | String | &#x2716; | Text identifier for external integration |
  | Title | --title | String | &#x2716; | Field title |
  | Signature | --label | Structure Of KeyAndValue | &#x2716; | Form label. Key: en or ru, Value: Lable text |
  | Token | --token | String | &#x2716; | Access 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](https://dev.1c-bitrix.ru/rest_help/tasks/task/userfield/add.php)
:::
<br/>


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

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

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

    URL   = "b24-ar17wx.bitrix24.by";
    Token = "6ad03969006e9f06006b12e400000001000...";

    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);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint bitrix24 AddCustomTaskField \
             --url "b24-ar17wx.bitrix24.by" \
             --type "string" \
             --fieldname "TEXT_FIELD" \
             --externalid "BITRIX_TEXT_FIELD" \
             --title "Text field" \
             --label "{'en':'Some field','ru':'Nekotoroe pole'}" \
             --token "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint bitrix24 AddCustomTaskField ^
             --url "b24-ar17wx.bitrix24.by" ^
             --type "string" ^
             --fieldname "TEXT_FIELD" ^
             --externalid "BITRIX_TEXT_FIELD" ^
             --title "Text field" ^
             --label "{'en':'Some field','ru':'Nekotoroe pole'}" ^
             --token "***"
        ```
    </TabItem>
</Tabs>


```json title="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
  }
  }
```
