Hey,
I want to unlock a series of locked tickets. So I wrote a perl script which uses these small code snippets as shown in the otrs api doc.
In detail I am using Kernel::System::Ticket. I've created all the necessary objects and used the method “TicketLockSet”. So far the script works and all the specified tickets become unlocked. But in the end of the execution I get the following error:
(in cleanup) Can't call method "Get" on an undefined value at /opt/otrs-3.0.9/Kernel/System/EventHandler.pm line 195 during global destruction.
I'm not an experienced perl developer so maybe someone could give me a hint?
Thanks
Unlock Tickets with Perl API
Unlock Tickets with Perl API
OTRS 3.0.10 (produktiv)
-
- Znuny expert
- Posts: 250
- Joined: 12 Oct 2010, 01:35
- Znuny Version: 3.0.9
- Company: LRS Health
Re: Unlock Tickets with Perl API
Have you created an EventHandler object at the start of the script?
OTRS: 3.0.9 & ITSM 3.0.4 - OS: Windows 7 - DB: MySQL - Heaps of random/useful hacks 
[Major Code Changes]
ArticleFreeTime1-3
Ability to search ArticleFreeText

[Major Code Changes]
ArticleFreeTime1-3
Ability to search ArticleFreeText
Re: Unlock Tickets with Perl API
No, I haven't created it. How do I have to integrate the object?MichaelR wrote:Have you created an EventHandler object at the start of the script?
OTRS 3.0.10 (produktiv)
-
- Znuny expert
- Posts: 250
- Joined: 12 Oct 2010, 01:35
- Znuny Version: 3.0.9
- Company: LRS Health
Re: Unlock Tickets with Perl API
From what I can see you need to call EventHandlerInit and pass in the required variables. I don't think you are passing the appropriate vars.
If you post your code (or the section causing the error) I will be able to help you further.
If you post your code (or the section causing the error) I will be able to help you further.
OTRS: 3.0.9 & ITSM 3.0.4 - OS: Windows 7 - DB: MySQL - Heaps of random/useful hacks 
[Major Code Changes]
ArticleFreeTime1-3
Ability to search ArticleFreeText

[Major Code Changes]
ArticleFreeTime1-3
Ability to search ArticleFreeText
Re: Unlock Tickets with Perl API
Ok, thanks for the support. I've already solved the problem. It wasn't necessary to create an new EventHandler-Object because the TicketObject already creates it internally. So what I did:MichaelR wrote:From what I can see you need to call EventHandlerInit and pass in the required variables. I don't think you are passing the appropriate vars.
If you post your code (or the section causing the error) I will be able to help you further.
$TicketObject->TicketLockSet(..) and $TicketObject->EventHandler( Event => 'TicketLockUpdate'...) for all those tickets.
At the end of the script I call $TicketObject->EventHandlerTransaction();
and the problem is gone..
Thank you for your hints!
OTRS 3.0.10 (produktiv)