On Correspond, Take Unowned Ticket

I am creating a new queue for some slightly less technical users at my
company, and their manager has requested I set RT to have a user take
ownership of an unowned ticket when they correspond on it via email. I
have accomplished this, for the most part, by creating a scrip with
the following:

my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $CreatorId = $Transaction->CreatorObj->Id;
$Ticket->SetOwner($CreatorId);

The issue is, it shows up as "The RT System Itself - Given to user"
which then generates a notification to the user that the message was
given to them. I also considered change the last line such that:

$Ticket->_Set(Field=>‘Owner’, Value=>$CreatorId, RecordTransaction=>0);

But this obviously doesn’t log the transaction, and I DO want to see
the ownership change in the ticket’s history.

My question - can I run the SetOwner (or perhaps the _Set) command AS
the $CreatorId for the transaction? My goal is for it to show up as
"user - Taken" which will not generate the notification.

Thanks,
Matt

Following up since I sent this just before a long weekend (at least
here in the US). Is anyone able to offer any thoughts / point me in
the right direction regarding this?

Thanks,
MattOn Fri, Aug 31, 2012 at 1:13 PM, Matt Brennan brennanma@gmail.com wrote:

I am creating a new queue for some slightly less technical users at my
company, and their manager has requested I set RT to have a user take
ownership of an unowned ticket when they correspond on it via email. I
have accomplished this, for the most part, by creating a scrip with
the following:

my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $CreatorId = $Transaction->CreatorObj->Id;
$Ticket->SetOwner($CreatorId);

The issue is, it shows up as “The RT System Itself - Given to user”
which then generates a notification to the user that the message was
given to them. I also considered change the last line such that:

$Ticket->_Set(Field=>‘Owner’, Value=>$CreatorId, RecordTransaction=>0);

But this obviously doesn’t log the transaction, and I DO want to see
the ownership change in the ticket’s history.

My question - can I run the SetOwner (or perhaps the _Set) command AS
the $CreatorId for the transaction? My goal is for it to show up as
“user - Taken” which will not generate the notification.

Thanks,
Matt

I am creating a new queue for some slightly less technical users at my
company, and their manager has requested I set RT to have a user take
ownership of an unowned ticket when they correspond on it via email. I
have accomplished this, for the most part, by creating a scrip with
the following:

my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $CreatorId = $Transaction->CreatorObj->Id;
$Ticket->SetOwner($CreatorId);

The issue is, it shows up as “The RT System Itself - Given to user”
which then generates a notification to the user that the message was
given to them. I also considered change the last line such that:

$Ticket->_Set(Field=>‘Owner’, Value=>$CreatorId, RecordTransaction=>0);

But this obviously doesn’t log the transaction, and I DO want to see
the ownership change in the ticket’s history.

My question - can I run the SetOwner (or perhaps the _Set) command AS
the $CreatorId for the transaction? My goal is for it to show up as
“user - Taken” which will not generate the notification.

You’ll want to make a CurrentUser object using the CreatorObj and then
go load a new ticket as using that current user object. If you call
SetOwner on that ticket, it’ll be as if the user made the change.

You also probably want to have an ACL check, because people can have
ReplyToTicket without OwnTicket.

-kevin

Following up since I sent this just before a long weekend (at least
here in the US). Is anyone able to offer any thoughts / point me in
the right direction regarding this?

You may want to look at how
RT::Action::AssignUnownedToActor - Assigns unowned tickets to the transaction actor - metacpan.org does this.