[rt-users] Send ticket to other queue from the actions menu
Alex Peters
alex at peters.net
Thu Oct 9 07:17:09 EDT 2014
Does this code also actually move the ticket into the other queue?
I'm interested in doing something similar: setting up menu items to quickly
set the ticket's Starts date to predefined relative future values.
On 9 October 2014 18:43, Emmanuel Lacour <elacour at easter-eggs.com> wrote:
> On Wed, Oct 08, 2014 at 11:12:15PM +0200, Rinke Colen wrote:
> > I know how to define actions in RT_SiteConfig.pm like this:
> >
> > actions => [
> > '* -> closed' => {
> > label => 'Close',
> > update => 'Respond',
> > },
> >
> > But I need something fancier now. I want to send my ticket to another
> > queue from the Actions menu. I want this action to be available only
> from
> > some statuses in the lifecycle. How can I do this? (I have already
> > configured a mapping under __maps__.)
> > Rinke
>
>
> You have to use a callback (a file named
> local/html/Callbacks/YourOrg/Elements/Tabs/Privileged). Then inside you
> have to write your logic to finally add the action to the menu, example:
>
> <%init>
> my $request_path = $HTML::Mason::Commands::r->path_info;
>
>
> # Only on ticket pages
> if ( $request_path =~ qr{^/Ticket/.*\.html} && $m->request_args->{'id'}
> && $m->request_args->{'id'} =~ /^\d+$/ ) {
>
> my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
> $Ticket->Load( $m->request_args->{'id'} );
>
> # Only if status is FIXME
> if ( $Ticket->Status eq 'FIXME' ) {
> my $tabs = PageMenu;
> my $actions = $tabs->child( 'actions' );
>
> my $Queue = RT::Queue->new( $session{'CurrentUser'} );
> $Queue->Load('YourTargetQueue');
>
> # Add our custom action here
> $actions->child(
> 'sendtoqueueX' => title => loc('Send to queue X'),
> path =>
>
> '/Ticket/Display.html?id='.$Ticket->Id.'&Queue='.$Queue->id
> );
> }
> }
> </%init>
>
> @BPS: would be nice to be able to specify an "url" in Lifecycle actions
> with basic replacements (__id__, ...)
>
>
> --
> Easter-eggs Spécialiste GNU/Linux
> 44-46 rue de l'Ouest - 75014 Paris - France - Métro Gaité
> Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
> mailto:elacour at easter-eggs.com - http://www.easter-eggs.com
> --
> RT Training November 4 & 5 Los Angeles
> http://bestpractical.com/training
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20141009/eac29d1b/attachment.htm>
More information about the rt-users
mailing list