Create a New Comment in the Timeline rpa.comment.add
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:
rpaWho 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 creates a new comment in the timeline of the item with the identifier itemId for the process with the identifier typeId.
View access to the element is enough to add a text comment. To attach files in 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 the required permission, the method returns the error "You do not have permission to add comments to this item".
|
Name |
Description |
|
typeId |
Identifier of the process |
|
itemId |
Identifier of the item |
|
fields |
Object describing the fields of the comment |
Parameter fields
|
Name |
Description |
|
description |
Description of the entry. HTML and BB-code formatting can be used |
|
files |
Array of attached files. Each element is an array containing the name and content encoded 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": [
[
"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' => [
[
'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": [
[
"document.pdf", "...base64_decoded_content..."
]
]
}
},
function(result) {
console.log('response', result.answer);
if(result.error())
alert("Error: " + result.error());
else
console.log(result.data());
}
)
Response Handling
HTTP Status: 200
{
"comment": {
"id": 350,
"createdTime": "2020-03-27T16:00:59+02:00",
"isFixed": false,
"typeId": 24,
"itemId": 10,
"action": "comment",
"description": "Mention of user with id 1",
"userId": 1,
"title": "Comment",
"data": {
"files": [
15
]
},
"createdTimestamp": 1585317659000,
"htmlDescription": "Mention of user with id 1 <a class=\"blog-p-user-name\" id=\"bp_K6r6vvp7\" href=\"/company/personal/user/1/\" bx-tooltip-user-id=\"1\">Anton Gorbylev</a> ",
"textDescription": "Mention of user with id 1 Anton",
"users": {
"1": {
"id": "1",
"name": "Anton",
"secondName": "",
"lastName": "",
"title": null,
"workPosition": "",
"fullName": "Anton",
"link": "/company/personal/user/1/"
}
}
}
}