Update Timeline Entry rpa.comment.update
Scope:
rpaWho can execute the method: any user
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.
Method Parameters
|
Name |
Description |
|
id |
Identifier of the comment |
|
fields |
Object describing the fields of the comment |
Fields Parameter
|
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 To add a new file, you need to pass a list as the record of the old file, where the key To upload new files, you also need to pass 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
- Comments: Overview of Methods
- Create a New Comment in the Timeline rpa.comment.add
- Delete Comment rpa.comment.delete