Skip to content

Fix service level deletion by rule#444

Merged
Rom1-B merged 3 commits intomainfrom
fix-service-level-deletion-vy-rule
Mar 12, 2026
Merged

Fix service level deletion by rule#444
Rom1-B merged 3 commits intomainfrom
fix-service-level-deletion-vy-rule

Conversation

@Lainow
Copy link
Contributor

@Lainow Lainow commented Mar 11, 2026

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes !42563
  • Here is a brief description of what this PR does
    When the user has a rule that adds an SLA when creating a ticket, if they have another rule that removes this SLA when deleting a technician group, the latter did not remove the group (whereas it did so without the plugin).
    The reason was that the rules did not trigger ONUPDATE because no field was changed when the group was removed, as removeAssignGroup() deletes the old group directly in SQL, without going through the rules engine.

To correct this, before deleting the old group, we call $ticket->getFromDB() then $ticket->update() with _actors containing only the new group. GLPI then detects the old group as deleted in transformActorsInput(), loadActorsForRules() sees a real change, and the business rules are executed with the correct final state (SLA deleted, etc.). The _plugin_escalade_rules_only flag is passed to prevent re-entry into the escalation logic.

And in pre_item_update, immediate return if _plugin_escalade_rules_only is present, letting prepareInputForUpdate() run the rules and save the results normally.

Screenshots (if appropriate):

@Lainow Lainow requested a review from stonebuzz March 11, 2026 14:36
@Lainow Lainow self-assigned this Mar 11, 2026
@Lainow Lainow requested a review from Rom1-B March 11, 2026 14:39
@Rom1-B Rom1-B merged commit 6decae9 into main Mar 12, 2026
3 checks passed
@Rom1-B Rom1-B deleted the fix-service-level-deletion-vy-rule branch March 12, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants