You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2022-02-02 11:45:51

antoniolopez
Member
Registered: 2013-12-05
Posts: 47

Satisfaction surveys sent now for incidents closed years ago

Hello,

We have glpi 9.5.6.

We have external surveys configured, for tickets closed after 06-12-2021 15:00:00. However, sometimes they are sent for tickets closed years ago.

Can anybody help me?

Thank you

Offline

#2 2023-05-04 17:48:07

spamma.master
Member
Registered: 2016-01-05
Posts: 70

Re: Satisfaction surveys sent now for incidents closed years ago

Having the same bug, I suspect the SQL request is using always the same start date... so not working as expected..

I do not know if a patch is available or not for v9 (I am stuck with v9 atm too), but the request should not work like that (should use the "Create survey after" date limit instead)

Any info appreciated (I guess removing the date might be even worse, retrieving all tickets since beginning..)

An idea => update this "Closed after" date every day (if you launch the survey generation every day), so you only have ticket closed last 24h triggering surveys..

Offline

#3 2023-05-04 22:21:02

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,813
Website

Re: Satisfaction surveys sent now for incidents closed years ago

There was a bug for a long time where it was using the wrong field as the index which caused notifications to be sent with the wrong data.

Fixed for 9.5.8:
https://github.com/glpi-project/glpi/pull/10890


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#4 2023-05-05 06:48:42

spamma.master
Member
Registered: 2016-01-05
Posts: 70

Re: Satisfaction surveys sent now for incidents closed years ago

I will check but I think I already applied this fix, but still a problem

Offline

#5 2023-05-05 06:53:03

spamma.master
Member
Registered: 2016-01-05
Posts: 70

Re: Satisfaction surveys sent now for incidents closed years ago

Yes I confirm, it is not related to that (where indeed there was a wrong match)

Patch already applied but another problem there:
      if (count($oldvalues)) {
         Log::constructHistory($this, $oldvalues, $this->fields);
         //$this->getFromDB($this->fields['id']); ///https://github.com/glpi-project/glpi/pull/10890/commits/eb23aaebec2e1674cc2a94d36c0293375abe1306
         $this->getFromDB($this->fields[$this->getIndexName()]);
      }


         //$this->getFromDB($this->fields['id']); ///https://github.com/glpi-project/glpi/pull/10890/commits/eb23aaebec2e1674cc2a94d36c0293375abe1306
    $this->getFromDB($this->fields[$this->getIndexName()]);

Offline

#6 2023-05-12 12:18:10

spamma.master
Member
Registered: 2016-01-05
Posts: 70

Re: Satisfaction surveys sent now for incidents closed years ago

Hi there,

I did investigate a bit and it seems that after each run of the closeticket (automatic action), the value "For tickets closed after" in the Root entity is updated each time to avoid running surveys on old tickets:  The field is max_closeddate in the glpi_entities table

For my sub entity (called IT), the value is fixed to a specific date and I would like to know where (in the code) this value is updated, to understand why it is not updated automatically for the sub entity
=> Maybe there is a field saying if the max_closeddate is automatically populated with the last inquest run date minus X days or something like that

Last edited by spamma.master (2023-05-12 12:21:03)

Offline

#7 2023-05-15 12:03:41

spamma.master
Member
Registered: 2016-01-05
Posts: 70

Re: Satisfaction surveys sent now for incidents closed years ago

After a bit of debug, I found that the max_closedate is updated for the Root entity but the child are never updated (and the child value is used to generate surveys for the current entity):
"$table.closedate"            => ['>', $max_closedate]
https://github.com/glpi-project/glpi/bl … 1-L6028C76

The max_closedate is never updated in DB except for the root entity, so there is a problem there..

At the end of survey generation, you can find this:
// Sauvegarde du max_closedate pour ne pas tester les meme tickets 2 fois
      foreach ($maxentity as $parent => $maxdate) {
         $conf->getFromDB($parent);
         $conf->update(['id'            => $conf->fields['id'],
                             //'entities_id'   => $parent,
                             'max_closedate' => $maxdate]);
      }

This update the max_closedate for Root but never for child entities... (at least after my testing & verification in DB)

Offline

Board footer

Powered by FluxBB