[Solved] TicketStateUpdate not triggered

Moderator: crythias

Post Reply
tomwerf
Znuny newbie
Posts: 6
Joined: 21 Jun 2013, 14:34
Znuny Version: 3.3.14
Real Name: Tom
Company: LekL

[Solved] TicketStateUpdate not triggered

Post by tomwerf »

Hi all,

When a ticket is closed by an agent, I want to trigger a -non Perl- script on my linux server.
Unfortunately TicketStateUpdate is not triggered on 'TicketStateUpdate'.

I used the tutorial from Crythias on: viewtopic.php?t=10090

So I created in Kernel/Config/Files a file called: TicketInvokeCMS.xml:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<otrs_config version="1.0" init="Changes">
    <ConfigItem Name="Ticket::EventModulePost###InvokeCMS" Required="0" Valid="1">
        <Description Lang="en"></Description>
        <Description Lang="de"></Description>
        <Group>Ticket</Group>
        <SubGroup>Core::Ticket</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::System::Ticket::Event::TicketInvokeCMS</Item>
                <Item Key="Event">TicketStateUpdate</Item>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>
And in otrs/Kernel/System/Ticket/Event/ I've created a file: TicketInvokeCMS.pm.
for the time being, this file only adds a line to the log so I can see if this Event is triggered.

But when I close a ticket, nothing happeneds.

After changing the line in the XML

Code: Select all

<Item Key="Event">TicketStateUpdate</Item>
in

Code: Select all

<Item Key="Event">TicketQueueUpdate</Item>
I see the log after changing the queue.

Why will TicketStateUpdate not be triggered when I close a ticket?
Or how can I implement this?

Who can help me?

Kind regards, Tom
Last edited by tomwerf on 02 Oct 2015, 16:27, edited 1 time in total.
OTRS 3.3.14 on Ubuntu lts 12.04.4 with MySQL database.
tomwerf
Znuny newbie
Posts: 6
Joined: 21 Jun 2013, 14:34
Znuny Version: 3.3.14
Real Name: Tom
Company: LekL

Re: TicketStateUpdate not triggered

Post by tomwerf »

Anyone?
OTRS 3.3.14 on Ubuntu lts 12.04.4 with MySQL database.
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: TicketStateUpdate not triggered

Post by eandrex »

Well, it is weird that it doesnt work..Another way to implement this, is by using the GenericAgent

"Admin" -> "Generic Agent" -> "AddTask"

Expand the "Execution based on events" and Add "TicketStateUpdate"

in ticket filter, select the states if necesary (if you want to restrict the execution of the module for only certain states)

Now expand the "Execute custom module" and fill in "Module" with "Kernel::System::Ticket::Event::TicketInvokeCMS" and clic "Save"
tomwerf
Znuny newbie
Posts: 6
Joined: 21 Jun 2013, 14:34
Znuny Version: 3.3.14
Real Name: Tom
Company: LekL

Re: TicketStateUpdate not triggered

Post by tomwerf »

Thanks! Works like a charm!

I don't understand why this is working and the way with the XML file doesn't.
Maybe a bug?
But this is a good workaround.

Regards, Tom
OTRS 3.3.14 on Ubuntu lts 12.04.4 with MySQL database.
Post Reply