[rt-devel] Module::Install and RTxInitDB

Tim Cutts tjrc at sanger.ac.uk
Fri Oct 19 11:37:15 EDT 2012


On 19 Oct 2012, at 16:04, Kevin Falcone <falcone at bestpractical.com> wrote:

> On Wed, Oct 17, 2012 at 01:08:29AM +0100, Tim Cutts wrote:
>> Aha - thanks for that. Worked out I needed another Module::Install
>> extension too... got where I needed to go now, and pushed my branches
>> (one for a tiny patch to RT itself needed for the module to work
>> correctly) and one for the module back up to github for Ruslan to look
>> at -- or indeed anyone else who's interested.
> 
> Ah, neat, you implemented the time-based limitation that I wanted (I'm
> judging from the branch name, I haven't had time to full review the
> code yet).

I've implemented all the things that Ruslan mentioned he hadn't had time to do:

* Configurable time limit.  There's a default, and you can also do it per queue.
* Automatic link creation to the previous ticket.  The type of link is configurable, also on a per-queue basis.
* Alter the subject line of the new ticket to remove the old RT tag.

The configuration is a hash, looking like this:

Set(%RepliesToResolved,
   default => {
     # 7 day time limit, create MemberOf link
     'reopen-timelimit' => 7,
     'link-type' => 'MemberOf',
   },
   'some-queue' => {
     # Always create new ticket, create a refers-to link
     'reopen-timelimit' => 0,
     'link-type' => 'RefersTo',
   },
   'exception-queue' => {
     # Traditional RT behaviour; disable the extension for this queue
     'reopen-timelimit' => undef,
   },
);


> I'd be interested to see the bug report / pull request that you needed
> to make it work with RT.

The third of the above features requires the patch to RT.  I'll file a bug report about it, but basically RT::Interface::Email has already pulled out the Subject by the time it runs the ExtractTicketId function, which the extension overrides.  Since ExtractTicketId now changes the Subject header in the incoming message, I just added an extra line after calling ExtractTicketId to re-fetch the Subject, in case it's changed.  That's all.  The following commit is the relevant one:

https://github.com/tcutts/rt/commit/593b2fe645f43c5776c8a9c1921be4aed26b202b

Tim

-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 


More information about the rt-devel mailing list