From fab46cd10e3a949ae82254b3726f4b009189743b Mon Sep 17 00:00:00 2001 From: Jason Crome Date: Fri, 27 Sep 2024 11:37:47 -0500 Subject: [PATCH] Prep RT-Extension-Import-CSV 0.03 --- Changes | 5 +++++ META.yml | 2 +- README | 31 +++++++++++++++++++++---------- lib/RT/Extension/Import/CSV.pm | 2 +- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/Changes b/Changes index 60e6e04..043eb39 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for RT-Extension-Import-CSV +0.03 2024-09-27 +- Allow migration of Told date field +- Fix pod errors and documentation bugs +- Additional configuration for Zendesk migration added + 0.02 2024-09-19 - Improve handling of date/time values - Improve log messages diff --git a/META.yml b/META.yml index bc92865..6ff4b8f 100644 --- a/META.yml +++ b/META.yml @@ -24,7 +24,7 @@ requires: resources: license: http://opensource.org/licenses/gpl-license.php repository: https://github.com/bestpractical/rt-extension-import-csv -version: '0.02' +version: '0.03' x_module_install_rtx_version: '0.43' x_requires_rt: 5.0.0 x_rt_too_new: 5.2.0 diff --git a/README b/README index 2b74010..2247e36 100644 --- a/README +++ b/README @@ -77,10 +77,9 @@ CONFIGURATION function. In this configuration, the custom field Purchase Order ID must be - unique, and can accept accept a combination of values. To insert a row - with this config, RT must find no existing tickets, and for update RT - must only find a single matching row. If neither condition matches, the - CSV row is skipped. + unique. To insert a row with this config, RT must find no existing + tickets, and for update RT must only find a single matching row. If + neither condition matches, the CSV row is skipped. Excluding Existing Tickets By Status In the example above, when searching for an existing ticket for a PO, it @@ -473,8 +472,8 @@ EXAMPLES Putting it all together: migrating from Zendesk It's possible to migrate from Zendesk to Request Tracker using multiple - imports defined above. Starting with a Zendesk trial site as a basis, - the following steps are necessary before a migration can begin: + imports defined above. The following steps are necessary before a + migration can begin: Users must be exported via API Unfortunately, Zendesk only provides an export for what RT considers @@ -487,6 +486,15 @@ EXAMPLES Any of the default lists of tickets in Zendesk can be exported to CSV. See the Zendesk documentation for more information. + RT Priority field must be customized + Zendesk priorities do not align 1:1 with RT's by default. The + following can be dropped into your RT configuration to match + priorities between the two systems: + + Set(%PriorityAsString, + Default => { None => 0, Low => 25, Normal => 50, High => 75, Urgent => 100 }, + ); + Exporting user information via the Zendesk API includes a bunch of unnecessary values. For this import, the only columns that matter are name and email. @@ -525,8 +533,12 @@ EXAMPLES 'Requestor' => 'Requester', 'Created' => 'Requested', 'LastUpdated' => 'Updated', - 'CF.Ticket Type' => 'Topic', - 'CF.Channel' => 'Channel', + 'CF.Topic' => 'Topic', + 'Told' => 'Assignee updated', + 'Priority' => sub { + my %priority = RT->Config->Get('PriorityAsString'); + return $priority{ 'Default' }{ ($_[0]->{ 'Priority' }) }; + }, ); Set( %CSVOptions, ( @@ -535,8 +547,7 @@ EXAMPLES escape_char => '', ) ); - (you'll need to create two ticket custom fields: Ticket Type and - Channel) + (you'll need to create a custom field named Topic) If tickets were exported to a file named zendesk_tickets.csv, the following command will import tickets into your RT instance: diff --git a/lib/RT/Extension/Import/CSV.pm b/lib/RT/Extension/Import/CSV.pm index c869ef5..ba5e450 100644 --- a/lib/RT/Extension/Import/CSV.pm +++ b/lib/RT/Extension/Import/CSV.pm @@ -5,7 +5,7 @@ package RT::Extension::Import::CSV; use Text::CSV_XS; use Test::MockTime 'restore_time'; -our $VERSION = '0.02'; +our $VERSION = '0.03'; our( $CurrentRow, $CurrentLine, $UniqueFields );