[rt-users] on customfield changed
Robin Ericsson
robin.ericsson at profecta.se
Wed Mar 31 07:42:12 EST 2004
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
More information about the rt-users
mailing list