Assigning a ticket to a user

Hi,
I`d like to solve this situation:

A Requestor send an email to one queue.
Two watchers receive the corresponding email.

When one of the watchers answers the email I’d like him to be the owner of
the ticket if he is an AdminCC

what is the AdminCC id?
$self->TicketObj->QueueObj->AdminCc->id ???

my $Value = $self->TicketObj->QueueObj->AdminCc->id ;
$self->TicketObj->_Set(Field => ‘Owner’, Value => $Value);
return 1;

thank you!

Try

my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $CreatorId = $Transaction->CreatorObj->Id;
my $Queue = $Ticket->QueueObj;
my $val = $Transaction->Type eq ‘Correspond’ && $Queue->IsAdminCc($CreatorId);
$Ticket->SetOwner($CreatorId) if $val;
return 1;

At 02:17 PM 4/26/2007, Ramon Loureiro wrote:

Hi,
I`d like to solve this situation:

A Requestor send an email to one queue.
Two watchers receive the corresponding email.

When one of the watchers answers the email I’d like him to be the owner of
the ticket if he is an AdminCC

what is the AdminCC id?
$self->TicketObj->QueueObj->AdminCc->id ???


my $Value = $self->TicketObj->QueueObj->AdminCc->id ;
$self->TicketObj->_Set(Field => ‘Owner’, Value => $Value);
return 1;

thank you!


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

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

Gene LeDuc, GSEC
Security Analyst
San Diego State University

Thank you!
But, as I understand, this makes the requestor=creator to be the owner, do
it?
I�d like the first watcher who answers the email to be the owner…

thanks for answering!!!

here is the test to see if there isn’t an owner and if the current actor
is an adminCC.

if the owner isn’t Nobody don’t worry about it.

return 0 unless ($self->TicketObj->OwnerObj->Name eq “Nobody”);

load the current user as a principal

my $actor = RT::Principal->new( $RT::SystemUser );
$actor->Load( $self->TransactionObj->CreatorObj->Id );

perldoc Ticket_Overlay.pm

return 1 if IsWatcher { Type => ‘AdminCC’, PrincipalId => $actor };
return 0;

For setting the current actor as the owner, I’ll leave that up to you.
( perldoc Ticket.pm, look for ‘SetOwner’ - there are examples on the wiki)

.r’

Ramon Loureiro wrote:

I could have it wrong, but it is working for me. Here’s how I understand it:

When the e-mail comes in, $self->TransactionObj->CreatorObj->Id is the user
id of the e-mail sender (because the sender’s e-mail “created” the
transaction).
my $CreatorId = $self->TransactionObj->CreatorObj->Id;

$val = $self->TicketObj->QueueObj->IsAdminCc($CreatorId) should return true
if the transaction creator (the e-mail sender) is a member of AdminCc for
that queue.

So, to set the owner of the ticket to the e-mail sender only if the sender
is in AdminCc:
$self->TicketObj->SetOwner($CreatorId) if $val;

At 03:35 PM 4/26/2007, you wrote:

Thank you!
But, as I understand, this makes the requestor=creator to be the owner, do
it?
I´d like the first watcher who answers the email to be the owner…

thanks for answering!!!

Try


my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $CreatorId = $Transaction->CreatorObj->Id;
my $Queue = $Ticket->QueueObj;
my $val = $Transaction->Type eq ‘Correspond’ &&
$Queue->IsAdminCc($CreatorId);
$Ticket->SetOwner($CreatorId) if $val;
return 1;

At 02:17 PM 4/26/2007, Ramon Loureiro wrote:

Hi,
I`d like to solve this situation:

A Requestor send an email to one queue.
Two watchers receive the corresponding email.

When one of the watchers answers the email I’d like him to be the owner
of
the ticket if he is an AdminCC

what is the AdminCC id?
$self->TicketObj->QueueObj->AdminCc->id ???


my $Value = $self->TicketObj->QueueObj->AdminCc->id ;
$self->TicketObj->_Set(Field => ‘Owner’, Value => $Value);
return 1;

thank you!


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

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


Gene LeDuc, GSEC
Security Analyst
San Diego State University

Gene LeDuc, GSEC
Security Analyst
San Diego State University

Hi again,

Let me explain better:
I’m trying to manage ticket properties without entering in the RT web
interface. This is the situation:

1.- Requestor A sends an email to the queue
2.- Watcher B receives the email as a CC user of the queue
3.- Watcher C receives the email as a AdminCC user of the queue
4.-.Watcher B answers the email. Nothing special happens
5.- Watcher C answers the email, Here is when I want the system to
change the owner to C

So I think I need to check if the one who is answering the message is
AdminCC

Some thin like
$self->TransactionObj->CorrespondingActor->Id;
?

thanks again

Gene LeDuc wrote:

Hello people,

I'm a a new user of RT and I'm having some problems.

After install, have it up and running I changed the messages

exchanged in RT (editing Scripts and Tamplates) and some users/group
permissions… So, I can’t make the requestors and AdminCc to receive the
message after resolve the ticket, RT is sending to the AdminCc as Comment
and to the requestor as Replay, the template created to be used when the
ticket is finished isn’t used by RT.

Someone can help me?

Regards,

Flavio Pereira
Support Analyst
http://www.guiasp.com.br

What you are describing is exactly what my code does. I’ve tested it, I
use it, and it works. If a sender is not an AdminCc for the queue, it will
return false. The “IsAdminCc($CreatorId)” function returns true only if
the argument is in the AdminCc group for that queue. If the $CreatorId is
a Cc member but not an AdminCc, the function returns false and you do not
set the Owner value.

Regards,
Gene

At 02:48 AM 4/27/2007, Ramon Loureiro wrote:

Hi again,

Let me explain better:
I’m trying to manage ticket properties without entering in the RT web
interface. This is the situation:

1.- Requestor A sends an email to the queue
2.- Watcher B receives the email as a CC user of the queue
3.- Watcher C receives the email as a AdminCC user of the queue
4.-.Watcher B answers the email. Nothing special happens
5.- Watcher C answers the email, Here is when I want the system to change
the owner to C

So I think I need to check if the one who is answering the message is AdminCC

Some thin like
$self->TransactionObj->CorrespondingActor->Id;
?

thanks again

Gene LeDuc wrote:

I could have it wrong, but it is working for me. Here’s how I understand it:

When the e-mail comes in, $self->TransactionObj->CreatorObj->Id is the
user id of the e-mail sender (because the sender’s e-mail “created” the
transaction).
my $CreatorId = $self->TransactionObj->CreatorObj->Id;

$val = $self->TicketObj->QueueObj->IsAdminCc($CreatorId) should return
true if the transaction creator (the e-mail sender) is a member of
AdminCc for that queue.

So, to set the owner of the ticket to the e-mail sender only if the
sender is in AdminCc:
$self->TicketObj->SetOwner($CreatorId) if $val;

At 03:35 PM 4/26/2007, you wrote:

Thank you!
But, as I understand, this makes the requestor=creator to be the owner, do
it?
I´d like the first watcher who answers the email to be the owner…

thanks for answering!!!

Try


my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $CreatorId = $Transaction->CreatorObj->Id;
my $Queue = $Ticket->QueueObj;
my $val = $Transaction->Type eq ‘Correspond’ &&
$Queue->IsAdminCc($CreatorId);
$Ticket->SetOwner($CreatorId) if $val;
return 1;

At 02:17 PM 4/26/2007, Ramon Loureiro wrote:

Hi,
I`d like to solve this situation:

A Requestor send an email to one queue.
Two watchers receive the corresponding email.

When one of the watchers answers the email I’d like him to be the owner
of
the ticket if he is an AdminCC

what is the AdminCC id?
$self->TicketObj->QueueObj->AdminCc->id ???


my $Value = $self->TicketObj->QueueObj->AdminCc->id ;
$self->TicketObj->_Set(Field => ‘Owner’, Value => $Value);
return 1;

thank you!


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

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


Gene LeDuc, GSEC
Security Analyst
San Diego State University

Gene LeDuc, GSEC
Security Analyst
San Diego State University