DonutsNL / ticketfilter

Matches foreign identifiers in the mailsubject and adds these as followups to existing GLPI tickets with the same patern.
GNU General Public License v2.0
2 stars 0 forks source link

Resolve not working #10

Closed JCHELIX closed 10 months ago

JCHELIX commented 10 months ago

Hi It seem's that the plugin isn't putting the ticket at the resolved status for this string inside the subjects

string "L'incident num INC0034498, Disfonctionnement des MAPs PRTG a été clôturé."

ticket match string : /.?(?(RITM|INC)[0-9]{7})./ Solved match string : /.?(?(RESOLU |clôturé|Clôturé)./

image

many thank for help on this.

DonutsNL commented 10 months ago

Hi @JCHELIX ,

Thanks for sharing this issue. I will dive into this issue somewhere this weekend.

rgrds,

DonutsNL commented 10 months ago

Performed some testing and as of yet have not been able to reproduce the issue. What has become clear is that additional logging will be very helpful in understanding potential logic issues.

image

image

JCHELIX commented 10 months ago

[2023-11-24 13:38:12] glpiphplog.CRITICAL: *** Uncaught Exception Error: Call to a member function xpath() on null in /glpi/src/RichText/UserMention.php at line 207 Backtrace : src/RichText/UserMention.php:91 Glpi\RichText\UserMention::getUserIdsFromUserMentions() src/CommonDBTM.php:1538 Glpi\RichText\UserMention::handleUserMentions() src/CommonDBTM.php:1324 CommonDBTM->post_addItem() src/CronTask.php:369 CommonDBTM->add() src/MailCollector.php:1916 CronTask->log() src/CronTask.php:1018 MailCollector::cronMailgate() front/cron.php:84 CronTask::launch()

usrloc@IKLSRV20002:/opt/dockervol/glpi/files/_log$ tail -n 100 php-errors.log marketplace/ticketfilter/src/Filter.php:70 GlpiPlugin\Ticketfilter\Filter::searchForMatches() src/Plugin.php:1665 GlpiPlugin\Ticketfilter\Filter::PreItemAdd() src/CommonDBTM.php:1275 Plugin::doHook() front/ticket.form.php:74 CommonDBTM->add()

[2023-11-24 12:48:59] glpiphplog.WARNING: ** PHP User Warning (512): TicketFilter: PregMatch failed! please review the Solved pattern /.?(?(RESOLU |clôturé|Clôturé|- Clôtu).*/ and correct it in /glpi/marketplace/ticketfilter/src/TicketHandler.php at line 301 Backtrace : marketplace/ticketfilter/src/TicketHandler.php:301 trigger_error() marketplace/ticketfilter/src/Filter.php:143 GlpiPlugin\Ticketfilter\TicketHandler->processTicket() marketplace/ticketfilter/src/Filter.php:70 GlpiPlugin\Ticketfilter\Filter::searchForMatches() src/Plugin.php:1665 GlpiPlugin\Ticketfilter\Filter::PreItemAdd() src/CommonDBTM.php:1275 Plugin::doHook() front/ticket.form.php:74 CommonDBTM->add()

JCHELIX commented 10 months ago

It seem's That my REGEXE patern isn't correct /.?(?(RESOLU |clôturé|Clôturé|- Clôtu)./

here's my test string : Elément demandé RITM0015898 - Clôturé

can you help me out on this ?

JCHELIX commented 10 months ago
image image
ChrisGralike commented 10 months ago

First glance the ( ,,, ) are not correct. Try: the following pattern instead. image

JCHELIX commented 10 months ago
image image
JCHELIX commented 10 months ago

[2023-11-24 14:30:40] glpiphplog.WARNING: *** PHP User Warning (512): TicketFilter: Length ofClôturé is longer then allowed by configured Ticket Match String Length in /glpi/marketplace/ticketfilter/src/TicketHandler.php at line 297 Backtrace : marketplace/ticketfilter/src/TicketHandler.php:297 trigger_error() marketplace/ticketfilter/src/Filter.php:143 GlpiPlugin\Ticketfilter\TicketHandler->processTicket() marketplace/ticketfilter/src/Filter.php:70 GlpiPlugin\Ticketfilter\Filter::searchForMatches() src/Plugin.php:1665 GlpiPlugin\Ticketfilter\Filter::PreItemAdd() src/CommonDBTM.php:1275 Plugin::doHook() front/ticket.form.php:74 CommonDBTM->add()

JCHELIX commented 10 months ago

Ok extended "Solved match group length" to 9 ==> this is now working

ChrisGralike commented 10 months ago

Thats great! 👍