Hi, I have a problem with adding a public_log from API.
When I'm try to add a comment this way - it's empty and it remove all my previous comments.
my json_data from request :
{
"operation": "core/update",
"class": "UserRequest",
"key": "114",
"comment":"test",
"fields": {
"title": "Test Title Update",
"public_log": {
"items": [
{
"add_entry": {
"message": "This is a comment with a title update.",
"user_login": "Admin123456"
}
}
]
}
}
}
in response, in 'public_log' section I get that :
"public_log": {
"entries": [
{
"date": "2024-10-08 09:54:49",
"user_login": "Admin Admin",
"user_id": "1",
"message": "",
"message_html": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<?xml encoding=\"UTF-8\"?>\n"
}
]
}
However, I have a bunch of comments added from Customer Portal and Ticket as well
Can you please give me an example of adding public_logs via API?
ITOP v3.2.0-2-14758
Last edit: Alexey 2024-10-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I have a problem with adding a public_log from API.
When I'm try to add a comment this way - it's empty and it remove all my previous comments.
my json_data from request :
in response, in 'public_log' section I get that :
However, I have a bunch of comments added from Customer Portal and Ticket as well
Can you please give me an example of adding public_logs via API?
ITOP v3.2.0-2-14758
Last edit: Alexey 2024-10-08
https://www.itophub.io/wiki/page?id=latest:advancedtopics:rest_json
Where did you see "add_entry" ? I see "add_item" ?
Yeah, you're right, it's "add_item", but it doesn't affect to comment creation. I got the same issue.
my actual json_data :
and the same response :
Mind that your structure is still incorrect. There shouldn't be "items", just "add_item" directly ;)
wow, thank you! now it works =)