[rt-users] On Correspond, Take Unowned Ticket

Kevin Falcone falcone at bestpractical.com
Fri Sep 7 14:13:45 EDT 2012


On Fri, Aug 31, 2012 at 01:13:56PM -0400, Matt Brennan 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.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120907/349b270a/attachment.sig>


More information about the rt-users mailing list