Skip to content

Commit

Permalink
fix(targetticket): actors format
Browse files Browse the repository at this point in the history
diferences exists between targettypes in format expected by GLPI
  • Loading branch information
btry committed Mar 25, 2024
1 parent 5c64327 commit e468aa3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions inc/targetticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,14 @@ public function save(PluginFormcreatorFormAnswer $formanswer): ?CommonDBTM {
// Cleanup actors array
$data = $this->cleanActors($data);

// Specific format for actors in tickets
// @see CommonITILObject::setTechAndGroupFromItilCategory()
if ($data['_users_id_assign'] === 0) {
$data['_users_id_assign'] = [];
$data['_users_id_assign_notif']['use_notification'] = [];
$data['_users_id_assign_notif']['alternative_email'] = [];
}

// Create the target ticket
$data['_auto_import'] = true;
if (!$ticketID = $ticket->add($data)) {
Expand Down

0 comments on commit e468aa3

Please sign in to comment.