Re: [rt-users] Search old tickets from within scrip

2007-08-08 Thread Keith Edmunds
On Wed, 8 Aug 2007 03:26:21 +0400, [EMAIL PROTECTED] said: I can suggest you another way with two scrips: 1) Update Company field of requestors when an user update customer custom field That's a smart idea, but how does one access the requestor's company field (presumably Organization) from

Re: [rt-users] Search old tickets from within scrip

2007-08-08 Thread Ruslan Zakirov
$user_obj-Organisation; # returns value $user_obj-SetOrganisation('new value'); # set new value `perldoc lib/RT/User.pm` - basic accessors `perldoc lib/RT/User_Overlay.pm` - more methods On 8/9/07, Keith Edmunds [EMAIL PROTECTED] wrote: On Wed, 8 Aug 2007 03:26:21 +0400, [EMAIL PROTECTED] said:

[rt-users] Search old tickets from within scrip

2007-08-07 Thread Keith Edmunds
RT 3.6.1 We have one custom field per ticket, Customer, of type 'select one value'. So far, we've set that value manually on each new ticket, but I'd like to automate it. What I'd like to do, within a script, is search for the last ticket from this requestor and set the customer custom field to

Re: [rt-users] Search old tickets from within scrip

2007-08-07 Thread Ruslan Zakirov
my $tickets = RT::Tickets-new( $RT::SystemUser ); $tickets-FromSQL(Requestor.EmailAddress = '$address' AND 'CustomField.{Customer}' IS NOT NULL); # fetch from DB only first one ticket $tickets-RowsPerPage(1); my $ticket = $tickets-First; return undef unless $ticket; return