Comments by API

I use API 2.0, and I need to make comments but without sending emails/notifications. Via the web interface, I disable the “All recipients” option and no notifications are sent.

Using the API, I POST the url /ticket/:id:/comment and in the Payload I use what I need to update, for example:
{
“Content”: "My comments… ",
“ContentType”: “text/plain”,
“Priority”: “50”
}

How do I disable the email notification when posting a comment?

Hello jeanrito,

It is possible that setting the comment triggers a queue script, which then sends the emails. Find out which script is responsible here and adjust the script.

Given it is possible to disable correspondence going out when using the Web UI, it seems reasonable to allow that via the REST API, however, I don’t recall that being exposed. It may need an extension to the API.

You can adjust condition for the relevant scrip. For REST API authentication you can use specific user, then add custom condition for the scrip On Comment Notify…., something like this:

return 0 if $self->TransactionObj->CreatorObj->Name eq ‘some_api_user’;

return 0 unless $self->TransactionObj->Type eq “Comment”;

return 1;

1 Like