[rt-users] Getting customfield value for a ticket

Kevin Falcone falcone at bestpractical.com
Thu Jun 24 10:03:17 EDT 2010


On Thu, Jun 24, 2010 at 03:38:50PM +0200, Johan Sjöberg wrote:
>    We have a custom field named "Customer" that we set for our tickets. I am trying to modify
>    this report to summarize time worked per customer during the given time period:
>    [1]http://wiki.bestpractical.com/view/TimeWorkedReport
> 
> 
> 
>    The problem I have is to get the custom field value for a ticket.
> 
> 
> 
>    I have a Ticket "Object" that is created by
> 
>    my $t = new RT::Ticket($session{'CurrentUser'});
> 
>       $t->Load($tr->ObjectId);
> 
> 
> 
>    After that I want to get the Custom Field value for this ticket. I can see the data in the
>    ObjectCustomFieldValues table, but I do not know how to get the information I want.
> 
>    I have the ticket id in $t->id and the CustomField id is 19.
> 
>    I have tried using the different functions available in the RT perl modules, but have been
>    unable to get it right.
> 
>    I know very little perl, so I have been working at a trial and error basis.
> 
> 
> 
>    Do you have any tips for me on how to get it to work?

All of the methods you might want for this are defined in RT::Record
and you can read their documentation with 
perldoc /opt/rt3/lib/RT/Record.pm

Try searching for CustomFieldValue

-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100624/fc9f4097/attachment.sig>


More information about the rt-users mailing list