[rt-users] getting the values of custom fields

Kenneth Crocker KFCrocker at lbl.gov
Tue Feb 13 14:16:30 EST 2007


Anthony,


	We use the following code to send a notification, via a scrip custom 
condition, when the owner changes, providing the owner isn't "nobody":

return ( $TicketObj->OwnerObj->Name() ne 'Nobody' );

	Maybe this will help you build your code in a scrip.


Kenn
LBNL

anthony wrote:
> I'm doing this via script action.
> FirstCustom.. is in Record which is not part of the $self.
> 
> I get TicketObj, TransactionObj ( which does not seems to work )
> 
> I'm tried to use CustomFieldValues but I get stuck after that.
> 
> Searches through the archive seem to say NO ONE has done this successfully.
> 
> 
> Kenneth Crocker wrote:
>> Anthony,
>>
>>     What are you using the data for? We pull some custom data to use on
>> our "Resolve" template. It is as follows:
>>
>> RT-Attach-Message: yes
>> Subject: Resolved: {$Ticket->Subject}
>>
>> Your request has been resolved. If you have any further questions or
>> concerns,
>> please respond to this message.
>>
>> To view ticket information, enter URL:
>>     {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} .
>> -----------------------------------------------------------------------------
>>
>>
>> Ticket Description:
>> {
>>      my $Resolution_Description;
>>      $Resolution_Description =
>> $Ticket->FirstCustomFieldValue('Description');
>>      return $Resolution_Description;
>> }
>> -----------------------------------------------------------------------------
>>
>>
>> Resolution:
>> {
>>      my $Resolution_Comment;
>>      my $Transactions;
>>      my $CommentObj;
>>
>>      $Transactions = $Ticket->Transactions;
>>      $Transactions->Limit( FIELD => 'Type', VALUE => 'Comment' );
>>      $Transactions->OrderByCols(
>>          { FIELD => 'Created',  ORDER => 'DESC' },
>>          { FIELD => 'id',     ORDER => 'DESC' },
>>          );
>>
>>      $CommentObj = $Transactions->First;
>>
>>      if  ($CommentObj && $CommentObj->id)
>>      {
>>           $Resolution_Comment = $CommentObj->Content;
>>      }
>>
>>      return $Resolution_Comment;
>> }
>>
>>     Hope this helps.
>>
>> Kenn
>> LBNL
>>
>> anthony wrote:
>>> I'm using 3.4.6 and have a ticket that has some CustomField values.
>>>
>>> I'm having a horrible time pulling these entries.
>>>
>>> I'm doing this via the web and User Defined scripts.  For testing I'm
>>> saying On status change run this action.
>>>
>>> I've been messing with Ticket_Overlay CustomValues, CustomValues,
>>> TicketTransactions....
>>>
>>> Now I'm wondering if the data is just for the status change transaction
>>> and the values in the custom fields are not even in the $self data.
>>>
>>> Does this sound right?
>>>
>>> Doing this via sql sounds much simpler.
>>> _______________________________________________
>>> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>>>
>>> Community help: http://wiki.bestpractical.com
>>> Commercial support: sales at bestpractical.com
>>>
>>>
>>> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>>> Buy a copy at http://rtbook.bestpractical.com
>>>
> 



More information about the rt-users mailing list