[rt-users] Recording user/requestor attributes in ticket custom fields

Kenneth Crocker kfcrocker at lbl.gov
Thu Feb 17 13:12:39 EST 2011


Peter,

What User values do you want to save from the Requestor (I assume they are
on the User Table) and what are the corresponding Custom Fields for each of
those values and what "type" did you set the CF's at?

Kenn
LBNL

On Thu, Feb 17, 2011 at 2:35 AM, Peter Nugent <peter.nugent at hetg.ie> wrote:

>  Hi all,
>
>
>
> I’m running RT 3.8.7 on Ubuntu 10.04 for a couple of months now so am
> fairly comfortable with the basics. I’d like to be able to record requestor
> info in custom fields with a ticket so that when an engineer is assigned the
> ticket this info can be part of the summary mailed to them.
>
>
>
> I’ve read that I can do this via a scrip and already have custom fields
> being set to default values but I can’t figure out what objects(Is this the
> correct term?) to set my user info custom field to?
>
>
>
> What I’m asking is pretty much the same as here
> http://www.gossamer-threads.com/lists/rt/users/98591 but I rather not use
> the callbacks just yet – I’d like to get my head around scrips and
> objects/variables first.
>
>
>
> I found the code below and modified it slightly I can’t remember its
> original function or where I found it for that matter but it was similar to
> what I was after – I think! Unfortunately I’m not getting anything stored in
> the Custom Field
>
>
>
> my $T_Obj = $self->TicketObj;
>
> my $requestor_address = $T_Obj->RequestorAddresses;
>
> my $cf_value;
>
> my $CF_Obj = RT::CustomField->new($self->CurrentUser);
>
> my $cf_name = "CSM Name"; #change this to the CF name
>
>
>
> $requestor_address =~ /(^.+)@([^\.].*\.[a-z]{2,}$)/;
>
> $cf_name = $1
>
> $CF_Obj->LoadByName( Name => $cf_name,);
>
> $RT::Logger->debug( "Loaded \$CF_Obj->Name = ". $CF_Obj->Name() ."\n" );
>
> $CF_Obj->AddValueForObject( Object  => $self->TicketObj,Content =>
> $cf_value, );
>
> return 1;
>
>
>
>
>
> Can someone point me in the right direction is the code I’m using even
> close?
>
>
>
> Thanks in advance and let me know if you need more info,
>
> Peter
>
>
>
>
>
>  *Peter Nugent* | Technical Director | +353 (0) 45-531262 | +353 (0)
> 45-940522
>
> Leinster Mills | Osberstown | Naas | Co. Kildare | Ireland |
> peter.nugent at hetg.ie | www.hetg.ie
>
>
>
> ------------------------------
>
> Hibernia Computer Services (KILDARE) T/A Hibernia Evros Technology Group
> Registered in Ireland No. 425932
> Registered Office: Block G, Cherrywood Science & Technology Park,
> Loughlinstown, Co. Dublin
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110217/906401bf/attachment.htm>


More information about the rt-users mailing list