Bug #5625

ticketsolved_updatetech option

Added by skita 18 days ago. Updated 17 days ago.

Status:ResolvedStart date:06/07/2021
Priority:NormalDue date:
Assignee:yllen% Done:

100%

Category:-
Target version:2.5.1

Description

ticketsolved_updatetech option is triggered even if state is not closed or solved

To try, enable option, from new ticket (status = new), affect a group
You will see our user assign as tech.

      if ($config->getField('ticketsolved_updatetech')) {
         $ticket_user      = new Ticket_User();
         if ((!$ticket_user->getFromDBByCrit(['tickets_id' => $ticket->fields['id'],
                                             'type'       => CommonITILActor::ASSIGN])
             || (isset($ticket_user->fields['users_id'])
                 && ($ticket_user->fields['users_id'] != Session::getLoginUserID())))
             && isset($ticket->oldvalues)
             && !in_array($ticket->oldvalues['status'], array_merge(Ticket::getSolvedStatusArray(),
                                                                    Ticket::getClosedStatusArray()))
             && in_array($ticket->input['status'], array_merge(Ticket::getSolvedStatusArray(),
                                                               Ticket::getClosedStatusArray()))) {

            $ticket_user->add(['tickets_id' => $ticket->getID(),
                               'users_id'   => Session::getLoginUserID(),
                               'type'       => CommonITILActor::ASSIGN]);
         }
      }

The first condition trigger the behavior.

You will find attached a patch to fix the problem.

fix_condition.patch Magnifier (1.02 KB) skita, 06/07/2021 04:07 PM

Associated revisions

Revision 340
Added by yllen 17 days ago

fixed #5625

History

#1 Updated by yllen 17 days ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r340.

#2 Updated by yllen 17 days ago

  • Assignee set to yllen
  • Target version set to 2.5.1

Also available in: Atom PDF