New Module: ImportExportPostmasterFilter

English! place to talk about development, programming and coding
Post Reply
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

New Module: ImportExportPostmasterFilter

Post by reneeb »

This is a new add on that allows admins to import/export postmaster filters. This can be useful if you want to transfer a postmaster filter from a test instance to the live instance...

http://opar.perl-services.de/dist/Impor ... sterFilter
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
bcerk
Znuny newbie
Posts: 21
Joined: 06 May 2013, 13:51
Znuny Version: 5.0.4
Real Name: Bostjan Cerk
Company: MAOP

Re: New Module: ImportExportPostmasterFilter

Post by bcerk »

Greetings!

have you planned version 5.x, too? I think this would be great. I really wondered, how that OTRS forgot or refused to make export/import for these filters (even in V5), since it can take long hours to enter them manually if you have many queues and many clients who send tickets by mail. So even just for backup reasons this is very helpful.

Thank you in advance.
best regards,
Bostjan
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: New Module: ImportExportPostmasterFilter

Post by reneeb »

Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
bcerk
Znuny newbie
Posts: 21
Joined: 06 May 2013, 13:51
Znuny Version: 5.0.4
Real Name: Bostjan Cerk
Company: MAOP

Re: New Module: ImportExportPostmasterFilter

Post by bcerk »

that was super speed :D
thank you!

It works in OTRS 5. Since it generates a plain text file that's easy to view (compared to Filter edit in OTRS: click one filter, scroll down, back one page, next filter etc) it also helps debugging Postmaster Filter settings and to manually correct errors in text editor. I think it should be a OTRS supported feature.

Few test results:
- if Postmaster Filter contains UTF-8 characters, they are not exported in a way that Filter Import would correctly interpret them;

- if only one filter is imported from .json file which already exists in OTRS, it seems to overwrite previous content, which is ok; but if the whole export file is re-imported over existing Filters with same names, it caused Internal Server Error (Apache/2.2.15) - tried on two test servers; it helps to simply delete all Filters in OTRS and Import again.

- the .json export file is continuing flow of characters so it's hard to notice the separator between Filter records. If the separator would be a LF/CR, this would also enable user to sort records in text editor, so they could be in the same order as displayed in OTRS.

Nevertheless, even as it is, it's really helpful. Thanks again.
best regards,
Bostjan
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: New Module: ImportExportPostmasterFilter

Post by reneeb »

Thanks for your feedback!

The two errors should be fixed as of version 5.0.2: http://opar.perl-services.de/dist/Impor ... lter-5.0.2
The "pretty print" isn't possible right now as the JSON object doesn't support that feature. But I created a pull request, so hopefully OTRS6 will support this (https://github.com/OTRS/otrs/pull/990).
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Post Reply