ResolveSendsReply

From Request Tracker Wiki
Jump to navigation Jump to search

4.x

With 4.x it's possible to accomplish "Reply on Resolve" by ticket Lifecycles. Just copy this to your RT_SiteConfig.pm:

Set(%Lifecycles,
    default => {
        initial         => [ 'new' ],
        active          => [ 'open', 'stalled' ],
        inactive        => [ 'resolved', 'rejected', 'deleted' ],

        defaults => {
            on_create => 'new',
            on_merge  => 'resolved',
            approved  => 'open',
            denied    => 'rejected',
        },

        transitions => {
            ''       => [qw(new open resolved)],
            # from   => [ to list ],
            new      => [qw(open stalled resolved rejected deleted)],
            open     => [qw(new stalled resolved rejected deleted)],
            stalled  => [qw(new open rejected resolved deleted)],
            resolved => [qw(new open stalled rejected deleted)],
            rejected => [qw(new open stalled resolved deleted)],
            deleted  => [qw(new open stalled rejected resolved)],
        },

        rights => {
            '* -> deleted'  => 'DeleteTicket',
            '* -> *'        => 'ModifyTicket',
        },

        actions => [
            'new -> open'      => {
                label  => 'Open It', # loc
                update => 'Respond',
            },
            'new -> resolved'  => {
                label  => 'Resolve', # loc
                update => 'Respond',
            },
            'new -> rejected'  => {
                label  => 'Reject', # loc
                update => 'Respond',
            },
            'new -> deleted'   => {
                label  => 'Delete', # loc
            },
            'open -> stalled'  => {
                label  => 'Stall', # loc
                update => 'Respond',
            },
            'open -> resolved' => {
                label  => 'Resolve', # loc
                update => 'Respond',
            },
            'open -> rejected' => {
                label  => 'Reject', # loc
                update => 'Respond',
            },
            'stalled -> open'  => {
                label  => 'Open It', # loc
            },
            'resolved -> open' => {
                label  => 'Re-open', # loc
                update => 'Respond',
            },
            'rejected -> open' => {
                label  => 'Re-open', # loc
                update => 'Respond',
            },
            'deleted -> open'  => {
                label  => 'Undelete', # loc
            },
        ],
    },
);

Original snippet is in RT_Config.pm. Only changes are "Comment" -> "Respond" in update parameters of actions.

It's necessary to copy all of default lifecycle section but not approvals.

3.8

This changes the Resolve link on a ticket's page to Reply rather than Comment by default. I've created this little patch for 3.8.1 :

--- share/html/Ticket/Elements/Tabs.bak 2008-12-05 16:44:05.000000000 +0100
+++ share/html/Ticket/Elements/Tabs     2008-12-05 16:44:51.000000000 +0100
@@ -177,7 +177,7 @@ if ($Ticket) {
         if ( $Ticket->Status ne 'resolved' ) {
             $actions->{'G'} = {
                 path =>
-                    "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id="
+                    "Ticket/Update.html?Action=Respond&DefaultStatus=resolved&id="
                     . $id,
                 title => loc('Resolve')
             };

Older Notes

For older versions put this in local/html/Callbacks/local/Ticket/Elements/Tabs/Default. Tested with 3.6.1. (Verified to work with my install of Rt 3.4.5)

<%init>
   
   # Change the "Resolve" link to reply instead of comment by default.
   
   {
       my $resolved = loc 'Resolve';
       while (my ($k, $v) = each %$actions) {
          if ($v->{title} eq $resolved) {
              $v->{path} =~ s/Comment/Respond/;
          }
       }
   }
   
   </%init>
   
   <%args>
       $actions => undef
   </%args>