You are not logged in.
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
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
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
I will check but I think I already applied this fix, but still a problem
Offline
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
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
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