Search code examples
restotrs

OTRS - How to disable triggers / invoker requests (OTRS to external webservices) on ticket update?


How can I disable triggers / invoker requests (OTRS to external service), when ticket is updated through REST?

About OTRS:

  • I have an application that updates the ticket in OTRS, externally through REST web services.

  • I have an invoker that requests web services externally on a certain event (e.g. queue update). It sends ticket information to update on other application, also through REST.

My issue is that when I update the ticket through REST, it does an request with the invoker which is not pretended.

I want to just the invokers to send requests when the ticket is updated on GUI / OTRS frontend.

Is it possible to do?


Solution

  • Work-around:

    I created an agent "ioz" on OTRS, that is used on the Webservices when authenticating.

    On the source code of the invoker, you add an condition to avoid further updates if the last user changing the ticket has the ID of the user "ioz" (e.g. #3).

    (And send an log message to OTRS if needed).

    # If last change (User ID) was done by user "ioz" we cancel the request
    
    if ($TicketInfo{ChangeBy} == 3) {
    
        return {
            Success      => 0,
            ErrorMessage => 'Request canceled, last changes were done through webservices by IOZ'
        };
    }**