Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Devel

Altering a new ticket's subject

 

 

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded


thomson.dan at gmail

Mar 20, 2009, 1:38 PM

Post #1 of 9 (1633 views)
Permalink
Altering a new ticket's subject

Hey all,

I've been playing with RT recently and I've been charged with making
small automatic modifications to a ticket's Subject field upon
reception of an email. I'm trying to do this in the least invasive way
possible, but I can't figure out how to do this without making
modifications to the actual RT code base.

What I'm doing presently is making use of the "Pre" callback in
mail-gateway to add some tags to the message subject line, then
returning the modification to $ARGS{'message'}.

eg.

diff -Nur rt-3.6.1/html/REST/1.0/NoAuth/mail-gateway
rt-3.6.1-subjecttags/html/REST/1.0/NoAuth/mail-gateway
--- rt-3.6.1/html/REST/1.0/NoAuth/mail-gateway 2009-03-20
14:10:23.000000000 -0400
+++ rt-3.6.1-subjecttags/html/REST/1.0/NoAuth/mail-gateway
2009-03-20 14:10:46.000000000 -0400
@@ -52,7 +52,11 @@
$ticket => undef
</%ARGS>
<%init>
-$m->comp('/Elements/Callback', _CallbackName => 'Pre', %ARGS);
+my %argsTmp = $m->comp('/Elements/Callback', _CallbackName =>
'Pre', %ARGS);
+if($argsTmp{'message'})
+{
+ $ARGS{'message'} = $argsTmp{'message'};
+}
use RT::Interface::Email (); # It's an exporter, but we don't care
$r->content_type('text/plain; charset=utf-8');
$m->error_format('text');


There's gotta be a better way, but I don't know the code well enough
myself. Can anybody point me in the right direction here? I'm
presently using version 3.6.1 (I know, I know, I know :)). Any help
would be appreciated.

Thanks,

--
Dan Thomson
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


jesse at bestpractical

Mar 23, 2009, 7:12 AM

Post #2 of 9 (1544 views)
Permalink
Re: Altering a new ticket's subject [In reply to]

Dan,

I'd recommend an RT::Interface::Email::Plugin

You can set the plugins you want in your RT_SiteConfig and the plugins
can massage messages before RT touches them.

On Fri, Mar 20, 2009 at 04:38:29PM -0400, Dan Thomson wrote:
> Hey all,
>
> I've been playing with RT recently and I've been charged with making
> small automatic modifications to a ticket's Subject field upon
> reception of an email. I'm trying to do this in the least invasive way
> possible, but I can't figure out how to do this without making
> modifications to the actual RT code base.
>
> What I'm doing presently is making use of the "Pre" callback in
> mail-gateway to add some tags to the message subject line, then
> returning the modification to $ARGS{'message'}.
>
> eg.
>
> diff -Nur rt-3.6.1/html/REST/1.0/NoAuth/mail-gateway
> rt-3.6.1-subjecttags/html/REST/1.0/NoAuth/mail-gateway
> --- rt-3.6.1/html/REST/1.0/NoAuth/mail-gateway 2009-03-20
> 14:10:23.000000000 -0400
> +++ rt-3.6.1-subjecttags/html/REST/1.0/NoAuth/mail-gateway
> 2009-03-20 14:10:46.000000000 -0400
> @@ -52,7 +52,11 @@
> $ticket => undef
> </%ARGS>
> <%init>
> -$m->comp('/Elements/Callback', _CallbackName => 'Pre', %ARGS);
> +my %argsTmp = $m->comp('/Elements/Callback', _CallbackName =>
> 'Pre', %ARGS);
> +if($argsTmp{'message'})
> +{
> + $ARGS{'message'} = $argsTmp{'message'};
> +}
> use RT::Interface::Email (); # It's an exporter, but we don't care
> $r->content_type('text/plain; charset=utf-8');
> $m->error_format('text');
>
>
> There's gotta be a better way, but I don't know the code well enough
> myself. Can anybody point me in the right direction here? I'm
> presently using version 3.6.1 (I know, I know, I know :)). Any help
> would be appreciated.
>
> Thanks,
>
> --
> Dan Thomson
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>

--
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


thomson.dan at gmail

Mar 23, 2009, 8:15 AM

Post #3 of 9 (1545 views)
Permalink
Re: Altering a new ticket's subject [In reply to]

Ah! Can't believe I missed that RawMessageRef argument. This is
exactly what I need.

Thanks!

2009/3/23 Jesse Vincent <jesse [at] bestpractical>:
>
> Dan,
>
> I'd recommend an RT::Interface::Email::Plugin
>
> You can set the plugins you want in your RT_SiteConfig and the plugins
> can massage messages before RT touches them.
>
> On Fri, Mar 20, 2009 at 04:38:29PM -0400, Dan Thomson wrote:
>> Hey all,
>>
>> I've been playing with RT recently and I've been charged with making
>> small automatic modifications to a ticket's Subject field upon
>> reception of an email. I'm trying to do this in the least invasive way
>> possible, but I can't figure out how to do this without making
>> modifications to the actual RT code base.
>>
>> What I'm doing presently is making use of the "Pre" callback in
>> mail-gateway to add some tags to the message subject line, then
>> returning the modification to $ARGS{'message'}.
>>
>> eg.
>>
>>        diff -Nur rt-3.6.1/html/REST/1.0/NoAuth/mail-gateway
>> rt-3.6.1-subjecttags/html/REST/1.0/NoAuth/mail-gateway
>>        --- rt-3.6.1/html/REST/1.0/NoAuth/mail-gateway  2009-03-20
>> 14:10:23.000000000 -0400
>>        +++ rt-3.6.1-subjecttags/html/REST/1.0/NoAuth/mail-gateway
>> 2009-03-20 14:10:46.000000000 -0400
>>        @@ -52,7 +52,11 @@
>>         $ticket => undef
>>         </%ARGS>
>>         <%init>
>>        -$m->comp('/Elements/Callback', _CallbackName => 'Pre', %ARGS);
>>        +my %argsTmp = $m->comp('/Elements/Callback', _CallbackName =>
>> 'Pre', %ARGS);
>>        +if($argsTmp{'message'})
>>        +{
>>        +   $ARGS{'message'} = $argsTmp{'message'};
>>        +}
>>         use RT::Interface::Email ();    # It's an exporter, but we don't care
>>         $r->content_type('text/plain; charset=utf-8');
>>         $m->error_format('text');
>>
>>
>> There's gotta be a better way, but I don't know the code well enough
>> myself. Can anybody point me in the right direction here? I'm
>> presently using version 3.6.1 (I know, I know, I know :)). Any help
>> would be appreciated.
>>
>> Thanks,
>>
>> --
>> Dan Thomson
>> _______________________________________________
>> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>>
>
> --
>



--
Dan Thomson
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


thomson.dan at gmail

Mar 23, 2009, 9:05 AM

Post #4 of 9 (1540 views)
Permalink
Re: Altering a new ticket's subject [In reply to]

It turns out that doesn't solve my problem.

Since I'm changing the subject line, I need a modified subject value,
but the subject is parsed out of the message before it ever hits the
plugins.

Basically, I need to modify $Message->head->get("Subject") (in
RT::Interface::Email::Gateway) but there's no way to do that from a
mail plugin.

2009/3/23 Dan Thomson <thomson.dan [at] gmail>:
> Ah! Can't believe I missed that RawMessageRef argument. This is
> exactly what I need.
>
> Thanks!
>
> 2009/3/23 Jesse Vincent <jesse [at] bestpractical>:
>>
>> Dan,
>>
>> I'd recommend an RT::Interface::Email::Plugin
>>
>> You can set the plugins you want in your RT_SiteConfig and the plugins
>> can massage messages before RT touches them.
>>
>> On Fri, Mar 20, 2009 at 04:38:29PM -0400, Dan Thomson wrote:
>>> Hey all,
>>>
>>> I've been playing with RT recently and I've been charged with making
>>> small automatic modifications to a ticket's Subject field upon
>>> reception of an email. I'm trying to do this in the least invasive way
>>> possible, but I can't figure out how to do this without making
>>> modifications to the actual RT code base.
>>>
>>> What I'm doing presently is making use of the "Pre" callback in
>>> mail-gateway to add some tags to the message subject line, then
>>> returning the modification to $ARGS{'message'}.
>>>
>>> eg.
>>>
>>>        diff -Nur rt-3.6.1/html/REST/1.0/NoAuth/mail-gateway
>>> rt-3.6.1-subjecttags/html/REST/1.0/NoAuth/mail-gateway
>>>        --- rt-3.6.1/html/REST/1.0/NoAuth/mail-gateway  2009-03-20
>>> 14:10:23.000000000 -0400
>>>        +++ rt-3.6.1-subjecttags/html/REST/1.0/NoAuth/mail-gateway
>>> 2009-03-20 14:10:46.000000000 -0400
>>>        @@ -52,7 +52,11 @@
>>>         $ticket => undef
>>>         </%ARGS>
>>>         <%init>
>>>        -$m->comp('/Elements/Callback', _CallbackName => 'Pre', %ARGS);
>>>        +my %argsTmp = $m->comp('/Elements/Callback', _CallbackName =>
>>> 'Pre', %ARGS);
>>>        +if($argsTmp{'message'})
>>>        +{
>>>        +   $ARGS{'message'} = $argsTmp{'message'};
>>>        +}
>>>         use RT::Interface::Email ();    # It's an exporter, but we don't care
>>>         $r->content_type('text/plain; charset=utf-8');
>>>         $m->error_format('text');
>>>
>>>
>>> There's gotta be a better way, but I don't know the code well enough
>>> myself. Can anybody point me in the right direction here? I'm
>>> presently using version 3.6.1 (I know, I know, I know :)). Any help
>>> would be appreciated.
>>>
>>> Thanks,
>>>
>>> --
>>> Dan Thomson
>>> _______________________________________________
>>> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>>>
>>
>> --
>>
>
>
>
> --
> Dan Thomson
>



--
Dan Thomson
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


jesse at bestpractical

Mar 23, 2009, 9:10 AM

Post #5 of 9 (1554 views)
Permalink
Re: Altering a new ticket's subject [In reply to]

On Mon 23.Mar'09 at 12:05:46 -0400, Dan Thomson wrote:
> It turns out that doesn't solve my problem.
>
> Since I'm changing the subject line, I need a modified subject value,
> but the subject is parsed out of the message before it ever hits the
> plugins.

What are you actually trying to do?


thomson.dan at gmail

Mar 23, 2009, 9:25 AM

Post #6 of 9 (1542 views)
Permalink
Re: Altering a new ticket's subject [In reply to]

I'm basically trying to tag ticket subjects (on creation) with pieces
of information related to the ticket requester.

So if a ticket comes in from person X (identified by their email
address), I can tag the subject
line with a few tidbits of information about them.

2009/3/23 Jesse Vincent <jesse [at] bestpractical>:
>
>
>
>
> On Mon 23.Mar'09 at 12:05:46 -0400, Dan Thomson wrote:
>> It turns out that doesn't solve my problem.
>>
>> Since I'm changing the subject line, I need a modified subject value,
>> but the subject is parsed out of the message before it ever hits the
>> plugins.
>
> What are you actually trying to do?
>



--
Dan Thomson
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


af at genevainformation

Mar 23, 2009, 9:35 AM

Post #7 of 9 (1549 views)
Permalink
Re: Altering a new ticket's subject [In reply to]

Sounds like "use a custom field":

While changing the subject seems a good thing to to at the first glance it's
not really sustainable. At one point you want to be able to sort by the
information or evaluate the queue. That's what custom fields are made for.
They are structured, manageable and provide much more logic than any subject
line ever will :-)

best
Alex



On Mon, Mar 23, 2009 at 5:25 PM, Dan Thomson <thomson.dan [at] gmail> wrote:

> I'm basically trying to tag ticket subjects (on creation) with pieces
> of information related to the ticket requester.
>
> So if a ticket comes in from person X (identified by their email
> address), I can tag the subject
> line with a few tidbits of information about them.
>
> 2009/3/23 Jesse Vincent <jesse [at] bestpractical>:
> >
> >
> >
> >
> > On Mon 23.Mar'09 at 12:05:46 -0400, Dan Thomson wrote:
> >> It turns out that doesn't solve my problem.
> >>
> >> Since I'm changing the subject line, I need a modified subject value,
> >> but the subject is parsed out of the message before it ever hits the
> >> plugins.
> >
> > What are you actually trying to do?
> >
>
>
>
> --
> Dan Thomson
> _______________________________________________
> List info:
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>


Joel.Schuweiler at schmoozecom

Mar 23, 2009, 9:58 AM

Post #8 of 9 (1534 views)
Permalink
Re: Altering a new ticket's subject [In reply to]

I agree, I did this at a previous company, if you want to set the subject off of a custom field, this is incredibly easy to do with a Scrip.

________________________________
From: rt-devel-bounces [at] lists [mailto:rt-devel-bounces [at] lists] On Behalf Of Alexander Finger
Sent: Monday, March 23, 2009 11:36 AM
To: Dan Thomson; rt-devel [at] lists
Subject: Re: [Rt-devel] Altering a new ticket's subject

Sounds like "use a custom field":

While changing the subject seems a good thing to to at the first glance it's not really sustainable. At one point you want to be able to sort by the information or evaluate the queue. That's what custom fields are made for. They are structured, manageable and provide much more logic than any subject line ever will :-)

best
Alex


On Mon, Mar 23, 2009 at 5:25 PM, Dan Thomson <thomson.dan [at] gmail<mailto:thomson.dan [at] gmail>> wrote:
I'm basically trying to tag ticket subjects (on creation) with pieces
of information related to the ticket requester.

So if a ticket comes in from person X (identified by their email
address), I can tag the subject
line with a few tidbits of information about them.

2009/3/23 Jesse Vincent <jesse [at] bestpractical<mailto:jesse [at] bestpractical>>:
>
>
>
>
> On Mon 23.Mar'09 at 12:05:46 -0400, Dan Thomson wrote:
>> It turns out that doesn't solve my problem.
>>
>> Since I'm changing the subject line, I need a modified subject value,
>> but the subject is parsed out of the message before it ever hits the
>> plugins.
>
> What are you actually trying to do?
>


--
Dan Thomson
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


thomson.dan at gmail

Mar 24, 2009, 1:17 PM

Post #9 of 9 (1532 views)
Permalink
Re: Altering a new ticket's subject [In reply to]

As a followup (in case anybody cares) this is the solution I went with
and it worked like a charm.

Thanks!

2009/3/23 Joel Schuweiler <Joel.Schuweiler [at] schmoozecom>:
> I agree, I did this at a previous company, if you want to set the subject
> off of a custom field, this is incredibly easy to do with a Scrip.
>
>
>
> ________________________________
>
> From: rt-devel-bounces [at] lists
> [mailto:rt-devel-bounces [at] lists] On Behalf Of Alexander
> Finger
> Sent: Monday, March 23, 2009 11:36 AM
> To: Dan Thomson; rt-devel [at] lists
> Subject: Re: [Rt-devel] Altering a new ticket's subject
>
>
>
> Sounds like "use a custom field":
>
> While changing the subject seems a good thing to to at the first glance it's
> not really sustainable. At one point you want to be able to sort by the
> information or evaluate the queue. That's what custom fields are made for.
> They are structured, manageable and provide much more logic than any subject
> line ever will :-)
>
> best
> Alex
>
>
> On Mon, Mar 23, 2009 at 5:25 PM, Dan Thomson <thomson.dan [at] gmail> wrote:
>
> I'm basically trying to tag ticket subjects (on creation) with pieces
> of information related to the ticket requester.
>
> So if a ticket comes in from person X (identified by their email
> address), I can tag the subject
> line with a few tidbits of information about them.
>
> 2009/3/23 Jesse Vincent <jesse [at] bestpractical>:
>>
>>
>>
>>
>
>> On Mon 23.Mar'09 at 12:05:46 -0400, Dan Thomson wrote:
>>> It turns out that doesn't solve my problem.
>>>
>>> Since I'm changing the subject line, I need a modified subject value,
>>> but the subject is parsed out of the message before it ever hits the
>>> plugins.
>>
>> What are you actually trying to do?
>>
>
>
> --
>
> Dan Thomson
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>
>



--
Dan Thomson
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.