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

Mailing List Archive: Request Tracker: Users

Adding AdminCCs on ticket creation

 

 

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


rt-users at thefreecat

Nov 18, 2009, 1:15 AM

Post #1 of 3 (581 views)
Permalink
Adding AdminCCs on ticket creation

Hello,

I need the following behaviour : when a ticket is created (in default queue),
if the suject contains "[PRH]" I must notify some special persons.

I first tried to change the ticket's queue but only the AdminCCs of the
default queue are notified.

So I tried adding the users during the creation process with this scrip :

=================================
Condition: during a transaction
Action: user defined
Template: Null
Stage: TransactionCreate

Custom action preparation code:

my $Ticket=$self->TicketObj;
my $Transaction = $self->TransactionObj;
if ($Ticket->Subject =~ /\[PRH\]/) {
$Ticket->SetQueue(20);
my $admincclist = $Ticket->AdminCc;
my $user = RT::User->new($RT::SystemUser);

my @comptes = (
'someone [at] somedomain'
,'other [at] somedomain'
);

foreach my $c(@comptes) {
$user->LoadByEmail($c);
$admincclist->AddMember($user->Id);
}

}
return 1;
=================================

Everything works but TOO LATE : ticket is moved to queue 20 and
AdminCCs are added to the ticket but they don't get the initial
(ticket creation ACK) email :

Fri Nov 06 14:59:41 2009: Request 3482 was acted upon.
Transaction: Ticket created by jcboggio
Queue: Default queue
Subject: Test [PRH] - NE PAS REPONDRE
Owner: Nobody
Requestor: jcboggio [at] somedomain
État: new
Ticket <URL: https://rt.somedomain.com/rt/Ticket/Display.html?id=3482 >

All the persons in the BCC are those from default queue.

How can I do this ? Can I re-emit this email afterwards ? any solution
is acceptable : my boss puts me under high pressure on this topic.

Thanks for your help,

JC
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales [at] bestpractical


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


kfcrocker at lbl

Nov 18, 2009, 9:07 AM

Post #2 of 3 (540 views)
Permalink
Re: Adding AdminCCs on ticket creation [In reply to]

JC,

I created something similar to this only it was for Ticket "CC's". As to
whether you want them to be added as Users or not, that could well be
done with your RT_SiteConfigure.pm file for auto create. We do that and
they become non-privileged users (Email only.
Anyway, I didn't want RT to add "CC's" automatically for all queues, so
I wrote this scrip to do it on a queue by queue basis. I put it in the
RT wiki. If you're interested, you could check it out and modify it for
your purposes. Hope it helps.

Kenn
LBNL

P.S. I noticed your code didn't have a "Return 1: in the Cleanup Action
Code. That is important as well.

On 11/18/2009 1:15 AM, JC Boggio wrote:
> Hello,
>
> I need the following behaviour : when a ticket is created (in default queue),
> if the suject contains "[PRH]" I must notify some special persons.
>
> I first tried to change the ticket's queue but only the AdminCCs of the
> default queue are notified.
>
> So I tried adding the users during the creation process with this scrip :
>
> =================================
> Condition: during a transaction
> Action: user defined
> Template: Null
> Stage: TransactionCreate
>
> Custom action preparation code:
>
> my $Ticket=$self->TicketObj;
> my $Transaction = $self->TransactionObj;
> if ($Ticket->Subject =~ /\[PRH\]/) {
> $Ticket->SetQueue(20);
> my $admincclist = $Ticket->AdminCc;
> my $user = RT::User->new($RT::SystemUser);
>
> my @comptes = (
> 'someone [at] somedomain'
> ,'other [at] somedomain'
> );
>
> foreach my $c(@comptes) {
> $user->LoadByEmail($c);
> $admincclist->AddMember($user->Id);
> }
>
> }
> return 1;
> =================================
>
> Everything works but TOO LATE : ticket is moved to queue 20 and
> AdminCCs are added to the ticket but they don't get the initial
> (ticket creation ACK) email :
>
> Fri Nov 06 14:59:41 2009: Request 3482 was acted upon.
> Transaction: Ticket created by jcboggio
> Queue: Default queue
> Subject: Test [PRH] - NE PAS REPONDRE
> Owner: Nobody
> Requestor: jcboggio [at] somedomain
> État: new
> Ticket <URL: https://rt.somedomain.com/rt/Ticket/Display.html?id=3482 >
>
> All the persons in the BCC are those from default queue.
>
> How can I do this ? Can I re-emit this email afterwards ? any solution
> is acceptable : my boss puts me under high pressure on this topic.
>
> Thanks for your help,
>
> JC
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales [at] bestpractical
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
>
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales [at] bestpractical


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


rt-users at thefreecat

Nov 19, 2009, 9:08 AM

Post #3 of 3 (523 views)
Permalink
Re: Adding AdminCCs on ticket creation [In reply to]

Ken,

Ken Crocker a écrit :
> I created something similar to this only it was for Ticket "CC's".

I've found two interesting pages on the wiki, this one being the
solution :

http://wiki.bestpractical.com/view/AddWatcherPerTicket

This one is quite interesting too :

http://wiki.bestpractical.com/view/ScripExecOrder


Thanks for pointing me there.

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales [at] bestpractical


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Request Tracker users 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.