On 3/15/2007 1:40 PM, Kenneth Crocker wrote:

But to no avail. We need some help help here. Obviously, thereis something I do not understand. Is this data just not available from the ticket yet? I do not have the cf defined for a transaction. Thanks.

Here's what I have in one of my conditions for new tickets. It basically checks to see if the field is valued, and if not, the action will set a default value:

sub IsApplicable
{
        my($self) = shift;

        my($CFNAME) = 'FooBarBaz';

        my($q) = $self->TicketObj->QueueObj;
        my($cf) = new RT::CustomField $q->CurrentUser;

        $cf->LoadByNameAndQueue(Name => $CFNAME, Queue => $q->id);
        $cf->LoadByNameAndQueue(Name => $CFNAME, Queue => 0) unless $cf->id;
        unless ($cf->id) {
$RT::Logger->warning("Custom field '$CFNAME' isn't global or defined for queue '" . $q->Name . "'");
                return undef;
        }

        return ! $self->TicketObj->FirstCustomFieldValue($cf->id);
}

This works on 3.6.3

--
Regards,


joe
Joe Casadonte
[EMAIL PROTECTED]

==========                                                  ==========
== The statements and opinions expressed here are my own and do not ==
== necessarily represent those of Oracle Corporation.               ==
==========                                                  ==========
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com

Reply via email to