[rt-users] Scrips help: adding admincc based on requestor's information

Mai Le mle at Niku.com
Wed Jan 12 02:14:11 EST 2005


 Hi All,

I'm new at creating scrips for RT.  I need to create a scrips to add an
additional admin to the existing admincc list if the requestor belongs
to a certain organization when the ticket is being created.  I'm not
sure how to check the requestor's Organization information field.

I have the following so far:

Condition: On Create
Action: User Defined
Template: Global template: blank
Stage: TransactionCreate

Custom action preparation code: 
	return 1;

Custom action cleanup code:
	my $admincclist = $self->TicketObj->AdminCC;
	if($self->TicketObj->Requestors->Organization eq "UK") {
		my $admin = RT::User->new($RT::SystemUser);
		$admin->LoadByEmail('blablah at somewhere.com');
		$admincclist->AddMember($user->Id);
	 return 1;
	}
else {
 return undef
}

However, it seems like it does not seems to detect the field correctly.
It's my first attempt at scrips so any help would be greatly
appreciated.

Thanks


CONFIDENTIALITY NOTICE: The information contained in this message and
or attachments is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material. Any
review, retransmission, dissemination, copying, or other use of this
information by persons or entities other than the intended recipient is
prohibited. If you received this e-mail or its attachments in error, 
please contact the sender and delete the material from any system and 
destroy any copies.



More information about the rt-users mailing list