2024-08-13 10:24:12 +00:00
|
|
|
---
|
|
|
|
sidebar_position: 2
|
|
|
|
---
|
|
|
|
|
|
|
|
# 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`
|
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|-|-|-|-|
|
|
|
|
| URL | --url | String | URL of webhook or a Bitrix24 domain, when token used |
|
|
|
|
| Type | --type | String | Field type: string, double, date, boolean |
|
|
|
|
| Name | --fieldname | String | Text identifier (name) of the field |
|
|
|
|
| ExternalID | --externalid | String | Text identifier for external integration |
|
|
|
|
| Title | --title | String | Field title |
|
|
|
|
| Signature | --label | Structure of KeyAndValue | Form label. Key: en or ru, Value: Lable text |
|
|
|
|
| Token | --token | String | Access token, when app auth method used |
|
2024-08-13 10:24:12 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
|
2024-08-13 10:24:12 +00:00
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
:::tip
|
|
|
|
Method at API documentation: [task.item.userfield.add](https://dev.1c-bitrix.ru/rest_help/tasks/task/userfield/add.php)
|
|
|
|
:::
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
```bsl title="Code example"
|
2024-08-14 09:06:31 +03:00
|
|
|
URL = "https://b24-ar17wx.bitrix24.by/rest/1/f2pp...";
|
2024-08-13 16:47:32 +03:00
|
|
|
|
|
|
|
Type = "date";
|
|
|
|
Name = "BIRTHDAY_FIELD";
|
|
|
|
|
|
|
|
Result = OPI_Bitrix24.AddCustomTaskField(URL, Type, Name);
|
|
|
|
|
|
|
|
URL = "b24-ar17wx.bitrix24.by";
|
|
|
|
Token = "fe3fa966006e9f06006b12e400000001000...";
|
|
|
|
|
|
|
|
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);
|
2024-08-13 10:24:12 +00:00
|
|
|
```
|
2024-08-13 15:52:26 +03:00
|
|
|
|
2024-08-13 10:24:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
```sh title="CLI command example"
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
oint bitrix24 AddCustomTaskField --url "b24-ar17wx.bitrix24.by" --type "string" --fieldname "TEXT_FIELD" --externalid "BITRIX_TEXT_FIELD" --title "Text field" --label %label% --token "fe3fa966006e9f06006b12e400000001000..."
|
2024-08-13 10:24:12 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-08-14 09:06:31 +03:00
|
|
|
{
|
2024-08-13 15:52:26 +03:00
|
|
|
"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
|
|
|
|
}
|
|
|
|
}
|
2024-08-13 10:24:12 +00:00
|
|
|
```
|