On customfield changed

Hi,

I have 2 scrips, one that checks whether a specific custom field is set
on creation of the ticket, if not set it to a specific value. It looks
like this:

“”"
my $Ticket = $self->TicketObj();
my $CFName = ‘Serviceniv�’;
my $CustomFields = $Ticket->QueueObj->CustomFields();

while (my $CustomField = $CustomFields->Next()) {
if ($CustomField->Name != $CFName) {
next;
}

my $CustomFieldValues =

$Ticket->CustomFieldValues($CustomField->Id);
if (!$CustomFieldValues->Count > 0) {
$Ticket->AddCustomFieldValue( Field => $CustomField->Id, Value
=> “Normal” );
return 1;
}
}

return 1;
"""

I also have a scrip that looks for changes on the customfield, it looks
like this:
""“
if ($self->TransactionObj->Type eq “CustomField”) {
return(1);
} else {
return(undef);
}
”""

The problem is that last one doesn’t catch when setting the custom field
upon ticket creation, and that is my question, how do I match the custom
field value upon ticket creation?

regards
Robin

if ($self->TransactionObj->Type eq “CustomField”) {
return(1);
}
elsif ($self->TransactionObj->Type eq “Create” && $self->TicketObj->FirstCustomFieldValue(“myField”) {
return(1);
} else {
return(undef);
}On Wed, Mar 31, 2004 at 02:42:12PM +0200, Robin Ericsson wrote:

I also have a scrip that looks for changes on the customfield, it looks
like this:
“”"
if ($self->TransactionObj->Type eq “CustomField”) {
return(1);
} else {
return(undef);
}
“”"

The problem is that last one doesn’t catch when setting the custom field
upon ticket creation, and that is my question, how do I match the custom
field value upon ticket creation?

regards
Robin


rt-users mailing list
rt-users@lists.bestpractical.com
The rt-users Archives

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm