
Hi, I'm new to OTRS as well as to Perl. I'm wondering how I can detect the failure in the function TicketMerge. Here is my script: ************************************** #!/usr/bin/perl use strict; use warnings; use utf8; use Kernel::System::ObjectManager; local $Kernel::OM = Kernel::System::ObjectManager->new(); my $TicketObject = $Kernel::OM->Get('Kernel::System::Ticket'); my $Success = $TicketObject->TicketMerge( MainTicketID => 1673, MergeTicketID => 1689123, UserID => 1, ) || die(); ************************************** Is this scenario, ticket id 1689123 does NOT exist and command TicketMerge fails but the script exits with success. How can I know when it fails? Regards ------------------------- Santiago DIEZ Quark Systems & CAOBA 23 rue du Buisson Saint-Louis, 75010 Paris -------------------------

Hi, I don´t test it, but normally try to remove <snip> || die() </snip> and look if $Success is true or false At the moment your script exits always with success, cause you say Merge OR Die and that happens I think. Kind regards, Stefan
I'm new to OTRS as well as to Perl.
I'm wondering how I can detect the failure in the function TicketMerge.
Here is my script:
************************************** #!/usr/bin/perl use strict; use warnings; use utf8;
use Kernel::System::ObjectManager; local $Kernel::OM = Kernel::System::ObjectManager->new(); my $TicketObject = $Kernel::OM->Get('Kernel::System::Ticket');
my $Success = $TicketObject->TicketMerge( MainTicketID => 1673, MergeTicketID => 1689123, UserID => 1, ) || die();
**************************************
Is this scenario, ticket id 1689123 does NOT exist and command TicketMerge fails but the script exits with success.
How can I know when it fails?
Regards ------------------------- Santiago DIEZ Quark Systems & CAOBA 23 rue du Buisson Saint-Louis, 75010 Paris ------------------------- --------------------------------------------------------------------- OTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/mailman/listinfo/otrs
-- Stefan Rother Geschäftsführer Oberwalting 31 | 94339 Leiblfing | Germany sr@otrs.ch M +49 (0)171 52 12 258 T +49 (0)9427 95 91 480 F +49 (0)9427 30 18 001 https://otrs.ch https://www.facebook.com/RotherOTRS https://www.twitter.com/Rother_OTRS

Hi,
I think TicketObject->TicketMerge doesn't check than the MergeTicket exists:
My interpretation is that all the things (article, watchers, etc) of the MergeTicket must move to the MainTicket. If MergeTicket exists, everything is moved (success!). If it doesn't exist, nothing has to be moved (success!). Or something like that.
Kind regards,
Juan Clavero
-----Mensaje original-----
De: otrs [mailto:otrs-bounces@lists.otrs.org] En nombre de Santiago DIEZ
Enviado el: miércoles, 26 de julio de 2017 16:19
Para: OTRS LIST
participants (3)
-
Juan Manuel Clavero Almirón
-
Santiago DIEZ
-
Stefan Rother