RotherOSS / ImportExportTicket

0 stars 0 forks source link

Import fails when there is no Type in the import data #7

Closed bschmalhofer closed 3 days ago

bschmalhofer commented 1 week ago

The use case is an import where only the ticket number and the owner is given. But the import failed. It is not obvious whether this was with an update of an existing ticket or with the creation of a new ticket.

ERROR: OTOBO-otobo.Console.pl-Admin::ImportExport::Import-74 Perl: 5.38.2 OS: linux Time: Fri Sep 6 10:09:46 2024

Message: Need TypeID!

Traceback (36937): Module: Kernel::System::Ticket::TicketTypeSet Line: 2033 Module: Kernel::System::ImportExport::ObjectBackend::Ticket::_ImportTicket Line: 1540 Module: Kernel::System::ImportExport::ObjectBackend::Ticket::ImportDataSave Line: 1256 Module: Kernel::System::ImportExport::Import Line: 2439 Module: Kernel::System::Console::Command::Admin::ImportExport::Import::Run Line: 161 Module: (eval) Line: 484 Module: Kernel::System::Console::BaseCommand::Execute Line: 478 Module: Kernel::System::Console::InterfaceConsole::Run Line: 88 Module: bin/otobo.Console.pl Line: 40

ERROR: OTOBO-otobo.Console.pl-Admin::ImportExport::Import-74 Perl: 5.38.2 OS: linux Time: Fri Sep 6 10:09:46 2024

Message: Can't import entity 50: TicketImport: Could not update Type for TicketID 2345

Traceback (36937): Module: Kernel::System::ImportExport::ObjectBackend::Ticket::ImportDataSave Line: 1260 Module: Kernel::System::ImportExport::Import Line: 2439 Module: Kernel::System::Console::Command::Admin::ImportExport::Import::Run Line: 161 Module: (eval) Line: 484 Module: Kernel::System::Console::BaseCommand::Execute Line: 478 Module: Kernel::System::Console::InterfaceConsole::Run Line: 88 Module: bin/otobo.Console.pl Line: 40

bschmalhofer commented 1 week ago

In this case the feature Ticket::Type was presumably not activated. Ticket::Type was checked when presenting the list of fallback values. So no fallback could be defined. But the feature was not checked when updating the ticket. An error occurred during the import because the type wasn't available from either the import data or from the fallback options.

The error would likely not have occurred if "Empty fields indicate that the current values are kept" had been activated. This setting is recommended when doing imports that should only update specific values.

bschmalhofer commented 1 week ago

For fixing this, I enhanced the checks for the three optional features: Ticket::Type, Ticket::Responsible, and Ticket::Service. This should also be a contribution to solving #1 .

bschmalhofer commented 3 days ago

This seems to have worked. Closing this issue.