New Task Card: Overview of Changes

The new task card has moved comments to chat. The old task methods continue to function, except for operations involving comments. Changes are available starting from module version tasks 25.700.0.

What Remains Unchanged

  • The task.* methods for creating and updating tasks, files, and checklists work as before.
  • Adding a comment via task.commentitem.add is still functional.

What Has Changed in Comments

  • Updating and deleting comments using the methods task.commentitem.update and task.commentitem.delete no longer work. Use the Chat methods instead:
  • Retrieving the list of comments via task.commentitem.getlist is no longer functional. Get task chat messages through im.dialog.messages.get.
  • Use the method im.disk.file.commit to send files in the task chat.
  • The chat associated with the task is returned in the response of tasks.task.get. Use its identifier for requests in chat methods.

How to Get the Task Chat ID via tasks.task.get

Old API Version

POST https://{installation_address}/rest/{user_id}/{rest_app_password}/tasks.task.get
        {
            "taskId": 51,
            "select": ["CHAT_ID"]
        }
        

Example response:

{
            "result": {
                "task": {
                    "id": "3835",
                    "chatId": 2537,
                    "favorite": "N",
                    "group": [],
                    "action": {
                        ...
                    }
                }
            }
        }    
        

New API Version

Request the fields chat.id, chat.entityId, chat.entityType for the task:

POST https://{installation_address}/rest/api/{user_id}/{rest_app_password}/tasks.task.get
        {
            "id": 51,
            "select": ["id", "chat.id", "chat.entityId", "chat.entityType"]
        }
        

Example response:

{
            "result": {
                "item": {
                    "id": 51,
                    "chat": {
                        "id": 58,
                        "entityId": 51,
                        "entityType": "TASKS_TASK"
                    }
                }
            }
        }
        

Starting from module version tasks 25.700.0, some methods can be called in the new format.

The new API call differs by the addition of the /api/ parameter in the request.

Old version:

https://{installation_address}/rest/{user_id}/{rest_app_password}/tasks.task.get

New version:

https://{installation_address}/rest/api/{user_id}/{rest_app_password}/tasks.task.get

Documentation for the new version of the method call is available in OpenApi format. To obtain OpenApi, call the method documentation:

https://{installation_address}/rest/api/{user_id}/{rest_app_password}/documentation

How to Send Messages to a Task

Events

  • The event OnTaskCommentAdd works. When working with the new task card, the handler will receive parameters:

    • MESSAGE_ID with the identifier of the message in the task chat,
    • TASK_ID with the identifier of the task,
    • 'ID' => 0 the identifier of the comment will equal zero.
  • The events OnTaskCommentUpdate and OnTaskCommentDelete do not work in the new task card.

Task Result

Widgets

The locations of the widgets TASK_VIEW_SIDEBAR, TASK_VIEW_TOP_PANEL, TASK_VIEW_TAB are no longer relevant in the new task card. In the new card, all widgets are displayed in a single "Applications" block.

All previously registered widgets continue to work. New widgets can also be registered, and they will be displayed in the "Applications" block.

Embedded Applications