Import::OTRS.diff_worker imports tickets without articles

Infos:

Used Zammad version: 4.1.0-1629278242.03345214.bionic amd64
Installation method (source, package, …): apt package
Operating system: Ubuntu 18.04.5 LTS
Database + version: 10.18 (Ubuntu 10.18-0ubuntu0.18.04.1)
Elasticsearch version: 7.14.0 amd64
Browser + version: not used, import done via console

OTRS version: 6.0.14
[Znuny4OTRS-Repo] 6.0.76
[Znuny4OTRS-ZammadMigrator] 6.0.7

Expected behavior:

  • Diff-import from OTRS creates new tickets in Zammad with article from OTRS

Actual behavior:

  • Diff-import from OTRS creates new tickets in Zammad without article from OTRS
  • Ticket title, number, created-time, customer, group, owner, state are imported as expected

Steps to reproduce the behavior:

  • Do initial import from OTRS
  • after initial import is done create new tickets in OTRS
  • do diff-import from OTRS

Import method

sudo -u zammad zammad run rails c

Delayed::Worker.max_run_time = 7.days

Setting.set('import_otrs_endpoint', 'https://otrs.xyz.com/otrs/public.pl?Action=ZammadMigrator')

Setting.set('import_otrs_endpoint_key', 'xxx')

Setting.set('import_mode', true)

Import::OTRS.start(threads: 6)

#Diff import

Delayed::Worker.max_run_time = 7.days

Setting.set('import_otrs_endpoint', 'https://otrs.xyz.com/otrs/public.pl?Action=ZammadMigrator')

Setting.set('import_otrs_endpoint_key', 'xxx')

Setting.set('import_mode', true)

Setting.set('system_init_done', false)

Import::OTRS.diff_worker

Reference

Has already been described in Import::OTRS.diff_worker creates/imports tickets without articles but closed after 4 months.

I have the same Problem, after diff_worker all new article are missing!.

I have the same problem and could not find a solution or a log to look at for errors.
Is there anything I can do?

Used Zammad version: 5.0.2-1635515988.3f1057c1.buster amd64
Installation method (source, package, …): apt package
Operating system: Debian GNU/Linux 10 (buster)
Database + version: 11.13-0+deb10u1
Elasticsearch version: 7.15.1 amd64
Browser + version: not used, import done via console

OTRS version: 6.0.21

Okay I think I found the issue.

The Znuny Extension was logging the following error during diff import:

OTRS-CGI-10[17939]: [Error][Kernel::System::ZnunyTime::TimeStamp2SystemTime][Line:236]: Need String!

I’ve edited Kernel/System/ZnunyTime.pm to print a stacktrace when this message comes and found out that the extention is looking for a “Created” field for the article.
In the database and Article.pm of OTRS the field is called “CreateTime”.
So I changed in file Kernel/System/Zammad/Migrator/Ticket.pm

                my $ArticleSystemTime = $TimeObject->TimeStamp2SystemTime(
                    String => $Article->{Created},
                );

to

                my $ArticleSystemTime = $TimeObject->TimeStamp2SystemTime(
                    String => $Article->{CreateTime},
                );

and the import worked.

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.