Osticket: Clear staff on transfer to dept

Created on 10 Jul 2014  Â·  24Comments  Â·  Source: osTicket/osTicket

It would be great to have the option to unassign staff on dept transfer.

Currently, when a ticket is assigned to a staff member and at some later point they transfer to a dept, it remains assigned to them and in their 'Answered' queue. When transferring to another dept, is it possible to clear the 'assigned staff' field?

Not sure how to make the changes, but I'm assuming it would be in these two files: scp/tickets.php and /include/class.ticket.php

Feature Request UI

Most helpful comment

Yes, still pending :(

All 24 comments

At least it should be done (for consistency) if that staff member is not in the destination department.

Exactly. Which in my case, that's the issue - staff member is not in the same dept

@protich what do you think? I think we should just add a checkbox to (optionally) unassign the ticket on the transfer.

My preferred behavior would be to unassign if the assigned user isn't a member of the destination department, with a check box to force unassign regardless.

Just my 2 cents.

@greezybacon - that works with me. The checkbox should be checked by default if the assigned staff doesn't have access to the target department or not a primary member and "Restrict ticket assignment to department members" is checked.

@protich
@greezybacon
Totally Agree with you and on that suggestion.

Michael

Leaving it assigned to someone that's not a member of the dest dept is IMVHO nonsense: if the ticket is being reassigned to another dept, it's because it requires that someone in _that_ dept do something... but a checkbox with a sane default (based on current owner's membership) should do.

@NdK73 - nonsense? That's a little strong word for a rational discussion.

osTicket supports assigning tickets to staff outside the department and will continue to do so unless you check "Restrict ticket assignment to department members" at the department level. This is important when you want to assign a ticket to a specific staff member in another department without exposing the ticket to ALL department members (that's what transfer will do). Not everyone uses osTicket they way _you_ use it - hence the setting.

The checkbox should be checked by default if the assigned staff doesn't have access to the target department

So the checkbox should change when you select a department from the drop down list?

@protich - sorry, it wasn't my intention to use a too strong word. What I meant is that I couldn't see any logic for it. I still don't see why one should transfer a ticket to another dept and assign it to someone not in that dept, but since there's probably someone using it for good reasons, and there's a way to do what I think is "right" (for me), then it's OK :)
@greezybacon - right. That would avoid surprises having tickets unassigned when "restrict to dept members" flag is selected but user doesn't tick "unassign on dept transfer".

I like the conclusion that this conversation has reached.
Which seems to be "Offer the option, default it to off."

any update on when we can expect this feature? Looking forward to it, thanks.

I am also interested in this feature, and the same when staff transfers to a team. Generally speaking, I expect that the lower levels are cleared when a ticket is assigned to a higher level: service > team > staff.

I'm also very interested in this feature. Best would we, if the transferred ticket is unassigned in a single step during transferring. I would not need this checkbox, but it would be okay.

Thank you so much :)

Any news about that?

Dear adrianoprospero,

I solved the "problem" by myself, I changed the code and take care of that specific change, whenever I install a new update of osTicket.

This is the howto, as I did it:

include/class.ticket.php
Line 753
.', staff_id=0, isanswered=0 WHERE ticket_id='.db_input($this->getId());

Thank you BernhardHutter!
I created a workaround in the workflow to deal with this issue without
change the code: I created an user to stay with the "unassigned" issues.
Then when an user must transfer an already assigned ticket to another
department, he must assign it to this "Unassigned user", turn back in the
browser an then transfer the ticket to the other department. This
"unassigned user" could also be an figurative "administrator" of the
destination department.
After the transfer, the user that transferred the ticket isn't seeing it
anymore in his list.

Best regards,

Adriano Gonçalves
Em 15/07/2015 06:07, "BernhardHutter" [email protected] escreveu:

Dear adrianoprospero,

I solved the "problem" by myself, I changed the code and take care of that
specific change, whenever I install a new update of osTicket.

This is the howto, as I did it:

include/class.ticket.php
Line 753
.', staff_id=0, isanswered=0 WHERE ticket_id='.db_input($this->getId());

—
Reply to this email directly or view it on GitHub
https://github.com/osTicket/osTicket-1.8/issues/1100#issuecomment-121537766
.

@greezybacon What version is this feature targeted for?

Is this feature request still pending?

Yes, still pending :(

@BernhardHutter

Have you done this for 1.10rc3? Could you supply previous and post lines of code to identify where to place:

include/class.ticket.php
Line 753
.', staff_id=0, isanswered=0 WHERE ticket_id='.db_input($this->getId());

This would also be usefully for Transfer to a different Team. Ideally the Agent is also unassigned if he is transferring it to a different Team.

Thank you

I sorted this out modifying ~/osticket/upload/include/class.ticket.php

if someone is interested:

modified function transfer:
2002 function transfer(TransferForm $form, &$errors, $alert=true) {

after the department was changed
2017 $this->dept_id = $dept->getId();

I added a line to relase the ticket:
2018 $this->unassign();

here are the first 20 lines of the function
2002 function transfer(TransferForm $form, &$errors, $alert=true) {
2003 global $thisstaff, $cfg;
2004
2005 // Check if staff can do the transfer
2006 if (!$this->checkStaffPerm($thisstaff, Ticket::PERM_TRANSFER))
2007 return false;
2008
2009 $cdept = $this->getDept(); // Current department
2010 $dept = $form->getDept(); // Target department
2011 if (!$dept || !($dept instanceof Dept))
2012 $errors['dept'] = __('Department selection required');
2013 elseif ($dept->getid() == $this->getDeptId())
2014 $errors['dept'] = sprintf(
2015 __('%s already in the department'), __('Ticket'));
2016 else {
2017 $this->dept_id = $dept->getId();
2018 $this->unassign(); //to release the ticket after department is changed

can anyone tell me why i'm not getting transfer option once the ticket is created from agent?

@akash65 your response does not appear to be on topic for this issue report unless you implemented a third partys code from this thread. Otherwise I expect that it is because your account does not have "transfer" privileges. I would invite you to seek your support experience at the support forums. http://osticket.com/forums

Was this page helpful?
0 / 5 - 0 ratings