--- sidebar_position: 3 description: Create task 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'; # Create task Create new task by fields structure `Function CreateTask(Val URL, Val FieldsStructure, Val Token = "") Export` | Parameter | CLI option | Type | Required | Description | |-|-|-|-|-| | URL | --url | String | ✔ | URL of webhook or a Bitrix24 domain, when token used | | FieldsStructure | --fields | Structure Of KeyAndValue | ✔ | Task fields structure. See GetTaskFieldsStructure | | Token | --token | String | ✖ | Access token, when app auth method used | Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
:::tip Method at API documentation: [tasks.task.add](https://dev.1c-bitrix.ru/rest_help/tasks/task/tasks/tasks_task_add.php) :::
```bsl title="1C:Enterprise/OneScript code example" // The complete structure of the fields can be obtained by the GetTaskFieldsStructure() function() CurrentDate = OPI_Tools.GetCurrentDate(); Hour = 3600; Day = 24; Responsible = 1; TaskData = New Structure; TaskData.Insert("TITLE" , "New task"); TaskData.Insert("DESCRIPTION" , "New task description"); TaskData.Insert("PRIORITY" , "2"); TaskData.Insert("DEADLINE" , CurrentDate + Hour * Day); TaskData.Insert("RESPONSIBLE_ID", Responsible); URL = FunctionParameters["Bitrix24_URL"]; Result = OPI_Bitrix24.CreateTask(URL, TaskData); URL = FunctionParameters["Bitrix24_Domain"]; Token = FunctionParameters["Bitrix24_Token"]; Result = OPI_Bitrix24.CreateTask(URL, TaskData, Token); ``` ```bash # JSON data can also be passed as a path to a .json file oint bitrix24 CreateTask \ --url "b24-ar17wx.bitrix24.by" \ --fields "{'TITLE':'New task','DESCRIPTION':'New task description','PRIORITY':'2','DEADLINE':'10/16/2025 09:49:24','RESPONSIBLE_ID':'1'}" \ --token "***" ``` ```batch :: JSON data can also be passed as a path to a .json file oint bitrix24 CreateTask ^ --url "b24-ar17wx.bitrix24.by" ^ --fields "{'TITLE':'New task','DESCRIPTION':'New task description','PRIORITY':'2','DEADLINE':'10/16/2025 09:49:24','RESPONSIBLE_ID':'1'}" ^ --token "***" ``` ```json title="Result" { "result": { "task": { "id": "8402", "parentId": null, "title": "New task", "description": "New task description", "mark": null, "priority": "2", "multitask": "N", "notViewed": "N", "replicate": "N", "stageId": "0", "sprintId": null, "backlogId": null, "createdBy": "1", "createdDate": "2025-10-15T09:49:30+00:00", "responsibleId": "1", "changedBy": "1", "changedDate": "2025-10-15T09:49:30+00:00", "statusChangedBy": null, "closedBy": null, "closedDate": null, "activityDate": "2025-10-15T09:49:30+00:00", "dateStart": null, "deadline": "2025-10-16T09:49:00+00:00", "startDatePlan": null, "endDatePlan": null, "guid": "{9d66ffbd-3c22-4486-b9c6-4cf997e510aa}", "xmlId": null, "commentsCount": null, "serviceCommentsCount": null, "allowChangeDeadline": "N", "allowTimeTracking": "N", "taskControl": "N", "addInReport": "N", "forkedByTemplateId": null, "timeEstimate": "0", "timeSpentInLogs": null, "matchWorkTime": "N", "forumTopicId": null, "forumId": null, "siteId": "s1", "subordinate": "Y", "exchangeModified": null, "exchangeId": null, "outlookVersion": "1", "viewedDate": null, "sorting": null, "durationFact": null, "isMuted": "N", "isPinned": "N", "isPinnedInGroup": "N", "flowId": null, "descriptionInBbcode": "Y", "status": "2", "statusChangedDate": "2025-10-15T09:49:30+00:00", "durationPlan": null, "durationType": "days", "favorite": "N", "groupId": "0", "auditors": [], "accomplices": [], "checklist": [], "group": [], "creator": { "id": "1", "name": "Антон Титовец", "link": "/company/personal/user/1/", "icon": "https://b24-ar17wx.bitrix24.by/b28528874/resize_cache/30/c0120a8d7c10d63c83e32398d1ec4d9e/main/d7e/d7e99cf556e4ab676463dae2c00ddfbb/a7e0af6899300e3c684caeca5c334d81.jpg", "workPosition": null }, "responsible": { "id": "1", "name": "Антон Титовец", "link": "/company/personal/user/1/", "icon": "https://b24-ar17wx.bitrix24.by/b28528874/resize_cache/30/c0120a8d7c10d63c83e32398d1ec4d9e/main/d7e/d7e99cf556e4ab676463dae2c00ddfbb/a7e0af6899300e3c684caeca5c334d81.jpg", "workPosition": null }, "accomplicesData": [], "auditorsData": [], "newCommentsCount": 0, "action": { "accept": false, "decline": false, "complete": true, "approve": false, "disapprove": false, "start": true, "pause": false, "delegate": true, "remove": true, "edit": true, "defer": true, "renew": false, "create": true, "changeDeadline": true, "checklistAddItems": true, "addFavorite": true, "deleteFavorite": false, "rate": true, "take": false, "edit.originator": false, "checklist.reorder": true, "elapsedtime.add": true, "dayplan.timer.toggle": false, "edit.plan": true, "checklist.add": true, "favorite.add": true, "favorite.delete": false }, "checkListTree": { "nodeId": 0, "fields": { "id": null, "copiedId": null, "entityId": null, "userId": 1, "createdBy": null, "parentId": null, "title": "", "sortIndex": null, "displaySortIndex": "", "isComplete": false, "isImportant": false, "completedCount": 0, "members": [], "attachments": [], "nodeId": null }, "action": [], "descendants": [] }, "checkListCanAdd": true } }, "time": { "start": 1760521770, "finish": 1760521770.48618, "duration": 0.48617696762085, "processing": 0, "date_start": "2025-10-15T09:49:30+00:00", "date_finish": "2025-10-15T09:49:30+00:00", "operating_reset_at": 1760522370, "operating": 0.34296703338623 } } ```