[rt-users] Lookup of Requestor Custom Field

Ruslan Zakirov ruslan.zakirov at gmail.com
Wed Apr 25 01:22:51 EDT 2012


You need FirstCustomFieldValue method instead of _Value.

Ruslan from phone.
25.04.2012 1:59 пользователь "Jourdan Perla" <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/20120425/c1b9fcb5/attachment.htm>


More information about the rt-users mailing list