Update Timeline Entry rpa.comment.update

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: rpa

Who can execute the method: any user

DEPRECATED

The development of this method has been halted. Please use Smart scripts as an alternative to this functionality.

This method updates the timeline entry with the identifier id. It only updates the title and description fields.

The method allows changes only to comments that were added by the same user. A Bitrix24 administrator can edit any comment.

To change the set of comment files, the user needs permission to edit the element: they are listed in the "Users allowed to edit stage items" setting of the current stage, or they are the element author allowed to start the workflow. Without this permission, files can contain only the IDs of files already attached, as an array of numbers. Adding a new file in such a request is not allowed: the method returns the error "You do not have permission to edit this comment".

Method Parameters

Name
type

Description

id
integer

Identifier of the comment

fields
object

An object describing the fields of the comment

Fields Parameter

Name
type

Description

description
integer

Description of the entry. HTML and BB-code formatting can be used

files
integer

An array of attached files. Each element is an array containing the name and content encoded in base64.

To add a new file, you must provide a list where the key id corresponds to the identifier of the file attached to this comment.

For uploading new files, you also need to provide an array with the name and content of the file in base64.

Code Examples

How to Use Examples in Documentation

try
        {
        	const response = await $b24.callMethod(
        		'rpa.comment.add',
        		{
        			"typeId": 24,
        			"itemId": 10,
        			"fields": {
        				"description": "Mention of user with id 1",
        				"files": [
        					{
        						"id": 15 // identifier of the old file
        					},
        					[
        						"another_document.pdf", "...base64_decoded_content..."
        					]
        				]
        			}
        		}
        	);
        	
        	const result = response.getData().result;
        	console.log('response', result.answer);
        	if(result.error())
        		alert("Error: " + result.error());
        	else
        		console.log(result);
        }
        catch( error )
        {
        	console.error('Error:', error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'rpa.comment.add',
                    [
                        'typeId' => 24,
                        'itemId' => 10,
                        'fields' => [
                            'description' => 'Mention of user with id 1',
                            'files'      => [
                                [
                                    'id' => 15 // identifier of the old file
                                ],
                                [
                                    'another_document.pdf', '...base64_decoded_content...'
                                ]
                            ]
                        ]
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Success: ' . print_r($result, true);
            echo 'response: ' . $result['answer'];
            if ($result['error']) {
                echo 'Error: ' . $result['error'];
            } else {
                echo 'Data: ' . print_r($result['data'], true);
            }
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error adding comment: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'rpa.comment.add',
            {
                "typeId": 24,
                "itemId": 10,
                "fields": {
                    "description": "Mention of user with id 1",
                    "files": [
                        {
                            "id": 15 // identifier of the old file
                        },
                        [
                            "another_document.pdf", "...base64_decoded_content..."
                        ]
                    ]
                }
            },
            function(result) {
                console.log('response', result.answer);
                if(result.error())
                    alert("Error: " + result.error());
                else
                console.log(result.data());
            }
        )
        

Continue Learning