[rt-users] Custom Condition based on Transaction Custom Field value

Andy Harrison aharrison at gmail.com
Sun Mar 6 20:11:42 EST 2005


On Sun, 06 Mar 2005 21:02:18 +0100, MP <marton.peter at gmail.com> wrote:
> Andy Harrison írta:
> 
> >On Sat, 5 Mar 2005 03:45:33 +0100, Péter Márton <marton.peter at gmail.com> wrote:
> >
> >
> >Please explain the problem clearly and what you're trying to do.  What
> >does "Custom Condition based on Transaction Custom Field value" have
> >to do with "$subject"?
> >
> >
> Sorry, i was very tired.
> I was able to make a scrip with a custom condition that checks the value
> of a custom field:
> 
> (from the wiki:)
> return undef unless ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~ /matchtext/i);
> return 1;
> 
> but (my problem is that) it checks only for "CustomField for queue", and i want to check a "Transaction Custom Field" value,
> and if i fetch a TransactionObj (with $self->TransactionObj) it has only a CustomFieldValues. Hmmm...
> So i tried this:
> 
> my $Ticket = $self->TransactionObj;
> my $CustomFieldValues=$Ticket->CustomFieldValues;
> while (my $CustomFieldValue = $CustomFieldValues->Next) {
> $RT::Logger->error( ".CFV. ".$CustomFieldValue->Content );
> }
> 
> But it logs nothing.

$self->TicketObj->FirstCustomFieldValue('yourfield') will return the
contents of a custom field from the current ticket.  Individual
transactions do not have custom fields.

What are you trying to do?

-- 
Andy Harrison



More information about the rt-users mailing list