[rt-users] Lookup of Requestor Custom Field

Jourdan Perla jkperla at ucdavis.edu
Thu Apr 26 16:55:09 EDT 2012


That did it. Thanks!

From: Ruslan Zakirov [mailto:ruslan.zakirov at gmail.com]
Sent: Tuesday, April 24, 2012 10:23 PM
To: Jourdan Perla
Cc: rt-users at lists.bestpractical.com
Subject: Re: [rt-users] Lookup of Requestor Custom Field


You need FirstCustomFieldValue method instead of _Value.

Ruslan from phone.
25.04.2012 1:59 пользователь "Jourdan Perla" <jkperla at ucdavis.edu<mailto:jkperla at ucdavis.edu>> написал:
I have a request to create a scrip that will automatically assign an owner to a ticket based on the requestor’s assigned Purchaser.

I have a Global custom field Purchaser, assigned to all Users.
Select one value.
For each value, Name is the username of the Purchaser, and Description is their full name (to make things easy for the managers).

So far my attempts to get the value of the custom field have ended in failure, mostly with
[error]: Impossible to assign the ticket to : That user does not exist ((eval 1502):10)

My current script is below. Am I missing something obvious here? I’ve been up and down the PODs and I’m not finding a fix for this.

PREP
return 1;


CLEANUP:
#Get requestor
my $Reqstr_Obj = $self->TicketObj->Requestors;
# get value of custom field, which should be user ID of newowner
my $newowner = $self->TransactionObj->CreatorObj->_Value('Purchaser');
$RT::Logger->error( $newowner );

#set the owner
my ($status, $msg) = $self->TicketObj->SetOwner( $newowner );
unless( $status ) {
    $RT::Logger->error( "Impossible to assign the ticket to $newowner: $msg" );
    return undef;
}
return 1;

-----
Jourdan Perla
BFTV Admin Group (BAE/FST/TEX/VEN)
University of California, Davis
530-752-3065

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120426/2c33b299/attachment.htm>


More information about the rt-users mailing list