[rt-users] How to use Requestor user in scrip?

Alex Vandiver alexmv at bestpractical.com
Thu Nov 21 10:06:47 EST 2013


On Thu, 2013-11-21 at 12:56 +0100, Bartosz Maciejewski wrote:
> I'm trying to get scrip that on status change set owner to requestor.

Remember that Requestors may be a list of users; it may also be empty.
Which do you intend to set the Owner to?  For instance, to simply set it
to the first requestor:

        # This will set $Actor to a user object
        my $Actor = $self->TicketObj->Requestors->First;
        
        # Stop if no requestors
        return unless $Actor;

You can then call ->Name or ->id on $Actor as you please.
 - Alex




More information about the rt-users mailing list