[rt-users] merge users(?)

Kenneth Crocker kfcrocker at lbl.gov
Mon May 3 12:07:50 EDT 2010


Bogey,

Sure. Keep in mind that if this is something you want to happen in ALL
Queues, Then you don't need thisw scrip. RT offers this as a Global option.
Anyway, here is the one for On Create from emails:

#Custom Action cleanup Code:
# Set up variables for parsing CC's

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $user = RT::User->new($RT::SystemUser);
my $addr;
my $header;
my $ccname;
my $cc;

# Parse the email CC's into ticket "CC" Watchers

foreach $header ($trans->Attachments->First->GetHeader("Cc"))
    {
     foreach $cc ( split /\,/, $header )
         {
          ($addr) = $cc =~ /([\w-]+?\@[\w-]+?\.[\w]+)/;
          $ccname = substr($addr, 0,length($addr)-8);
          $addr = $user->CanonicalizeEmailAddress($ccname);
          $ticket->AddWatcher( Type => 'Cc', Email => $ccname );
         }
    }

return 1;

For the "On Correspondence one, you merely add an "unless" after the $addr
code:

          unless ($ticket->IsWatcher(Type => 'Cc', EmailAddress => $addr))
              {
               $ticket->AddWatcher( Type => 'Cc', Email => $ccname );
              }

So anyway, you can put this code into any Queue you want this to happen in,
but again, if you want all Queue to have this, then its better to turn on
that option in you config settings.

Kenn
LBNL

On Sun, May 2, 2010 at 9:34 AM, HS <bogey_63 at yahoo.com> wrote:

> Hi Ken,
> could you provide this scrip, please? Would like to give it a try.
>
> Thanks!
>
> best
>
> --- Kenneth Crocker *<kfcrocker at lbl.gov>* schrieb am *Fr, 30.4.2010:
> *
>
> *
> Von: Kenneth Crocker <kfcrocker at lbl.gov>
> Betreff: Re: [rt-users] merge users(?)
> An: "who else" <bogey_63 at yahoo.com>
> CC: rt-users at lists.bestpractical.com
> Datum: Freitag, 30. April, 2010 18:34 Uhr
>
> *
> *Bogey,
>
> Did you consider just making the extra Users Cc's on the Ticket? Then all
> you would have to do is make sure there was a notification scrip for Cc's on
> whatever. We have a scrip that will "Add a Ticket CC" for all Cc's on an
> email when a ticket is created or on correspondence. That way, you don't
> have to have a CF and monitor/maintain it. I think it simpler.
>
> Kenn
> LBNL
>
> *
> *On Fri, Apr 30, 2010 at 9:27 AM, who else <bogey_63 at yahoo.com<http://mc/compose?to=bogey_63@yahoo.com>
> > wrote:
> *
>>
>> *
>> Someone, please?
>>
>> TIA
>>
>> w_e
>> *
>> *
>> who else wrote:
>> >
>> > Well,
>> > it seems it works.
>> >
>> > BUT:
>> >
>> > I worked it out this way:
>> >
>> >>There is a scrip that can do this:
>> >
>> >>http://wiki.bestpractical.com/view/AddRequestor
>> >
>> >>You create a custom user field called othermail and populate it with the
>> >>people you want to get the email. All, the other IBMers will be added as
>> >>requestors whenever one of them requests. We've done this for some
>> >>supervisors who want to keep an eye on all calls made by their staff.
>> >
>> > Unfortunately this only works for ONE additional othermail but not two.
>> It
>> > only accepts the first emailadress. Anybody out here, to point me in the
>> > right direction please, am not a programmer, so i'd appreciate your
>> help.
>> >
>> > Thank you very much.
>> >
>> > w_e
>> >
>> > PS: Besides this it works like a charm ;-)
>> >
>>
>> --
>> *
>> *View this message in context:
>> http://old.nabble.com/merge-users%28-%29-tp28151060p28414178.html
>> *
>> *Sent from the Request Tracker - User mailing list archive at Nabble.com.
>>
>>
>> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>> Buy a copy at http://rtbook.bestpractical.com
>> *
>>
> *
> *
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100503/e875d35e/attachment.htm>


More information about the rt-users mailing list