[rt-users] On Owner change set owner as AdminCC

Ruslan Zakirov ruz at bestpractical.com
Tue Mar 11 16:04:26 EDT 2008


On Tue, Mar 11, 2008 at 7:34 PM, John Arends <jarends at uiuc.edu> wrote:
> I'm trying to figure out how to write a scrip that will add a ticket
>  owner as an AdminCC. This way even if the owner changes, each person who
>  has ever owned the ticket will be on the AdminCC list.
>
>  I'm still very new to writing scrips so I may be missing something obvious.
>
>  Any suggestions?
>
>  This is what I have:
>
>  Condition: On Owner Change
>  Action: User Defined
>  Template: Global template: blank
>
>  Custom action preparation code: return 1;
>  Custom action cleanup code:
>
>   my $admincclist = $self->TicketObj->AdminCc;
>
>   my $Owner = $self->TicketObj->Owner;
$Owner is not an object but ID, you want to use OwnerObj instead to
get object, but in this particular case $self->TicketObj->Owner
returns new owner as ticket has been changed already. To get old owner
of the ticket you must use transaction object and its OldValue
property (id of a principal).

>
>   $admincclist->AddMember($Owner->Id);
>
>
>  _______________________________________________
>  http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
>  Community help: http://wiki.bestpractical.com
>  Commercial support: sales at bestpractical.com
>
>
>  Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>  Buy a copy at http://rtbook.bestpractical.com
>



-- 
Best regards, Ruslan.



More information about the rt-users mailing list