Reset Owner Link

English! place to talk about development, programming and coding
Post Reply
SuperDOS
Znuny newbie
Posts: 93
Joined: 17 Apr 2012, 16:16
Znuny Version: 6.0.3
Real Name: A!

Reset Owner Link

Post by SuperDOS »

Hi,

I'm trying to add a link (for example like the link Spam) to Frontend::Agent::Ticket::MenuModule that will reset the owner of the ticket to OTRS Admin just like ForceOwnerReset.pm does but without moving the ticket to another queue.
I've managed to add the link but think I can't use the ForceOwnerModule for this and have to create a new module.

Any help how to approach this?

Thanks
SuperDOS
Znuny newbie
Posts: 93
Joined: 17 Apr 2012, 16:16
Znuny Version: 6.0.3
Real Name: A!

Re: Reset Owner Link

Post by SuperDOS »

BUMP
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Reset Owner Link

Post by reneeb »

This should help, though it is untested... https://gist.github.com/reneeb/7788a5a8579bc12eb03b
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
SuperDOS
Znuny newbie
Posts: 93
Joined: 17 Apr 2012, 16:16
Znuny Version: 6.0.3
Real Name: A!

Re: Reset Owner Link

Post by SuperDOS »

Thanks! will try it.
SuperDOS
Znuny newbie
Posts: 93
Joined: 17 Apr 2012, 16:16
Znuny Version: 6.0.3
Real Name: A!

Re: Reset Owner Link

Post by SuperDOS »

Hi I've got round to test your code and I get the link, but it says "We are sorry, you do not have permissions anymore to access this ticket in its current state."

The user has full read/write to all groups.
Running it on OTRS 4.0.1

Here's the log

Wed Dec 3 15:12:06 2014 notice OTRS-CGI-09 Permission denied (UserID: 2 'ro' on TicketID: $QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 Need QueueID!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 Column 'queue_id' cannot be null, SQL: 'INSERT INTO ticket_history (name, history_type_id, ticket_id, article_id, queue_id, owner_id, priority_id, state_id, type_id, create_time, create_by, change_time, change_by) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?,
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Reset Owner Link

Post by crythias »

also Generic Agent.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Reset Owner Link

Post by reneeb »

For OTRS 4.x you have to replace

Code: Select all

$QData{"TicketID"}
with

Code: Select all

[% Data.TicketID | html %]
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: Reset Owner Link

Post by eandrex »

SuperDOS wrote:Hi I've got round to test your code and I get the link, but it says "We are sorry, you do not have permissions anymore to access this ticket in its current state."

The user has full read/write to all groups.
Running it on OTRS 4.0.1

Here's the log

Wed Dec 3 15:12:06 2014 notice OTRS-CGI-09 Permission denied (UserID: 2 'ro' on TicketID: $QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 Need QueueID!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 Column 'queue_id' cannot be null, SQL: 'INSERT INTO ticket_history (name, history_type_id, ticket_id, article_id, queue_id, owner_id, priority_id, state_id, type_id, create_time, create_by, change_time, change_by) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?,
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
Wed Dec 3 15:12:06 2014 error OTRS-CGI-09 No such TicketID ($QData{)!
it is because OTRS 4 no longer uses $QData{"TicketID"} you should have specified your version first so reneeb would have gave you a version according to your version.

in your xml

change

Code: Select all

$QData{"TicketID"}
to

Code: Select all

[% Data.TicketID | html %]
SuperDOS
Znuny newbie
Posts: 93
Joined: 17 Apr 2012, 16:16
Znuny Version: 6.0.3
Real Name: A!

Re: Reset Owner Link

Post by SuperDOS »

I just recently upgraded to OTRS 4 on our test environment, after applying the changes to the XML it works just fine.
Thanks!
Post Reply