[rt-users] Filling Dates fields with scrip
Cristiano da Costa
crsurf at gmail.com
Wed Feb 1 11:30:57 EST 2006
Hello
I want to fill the fields Starts, Started and Due after ticket creation, for
this I´m using the code bellow on custom action in "on create" condition
my $now = RT::Date->new($RT::SystemUser);
my $sla = RT::Date->new($RT::SystemUser);
$now->SetToNow;
$sla->SetToNow;
$sla->AddSeconds(+3600);
$self->TicketObj->SetStarts( $now->ISO );
$self->TicketObj->SetStarted( $now->ISO );
$self->TicketObj->SetDue( $sla->ISO );
return 1;
This works, but if user that create tickts already fill these fields I don´t
want to overwrite the user information, I tryed the following code in place
of the code above, but doesn´t work.
my $now = RT::Date->new($RT::SystemUser);
my $sla = RT::Date->new($RT::SystemUser);
$now->SetToNow;
$sla->SetToNow;
$sla->AddSeconds(+3600);
if ( $self->TicketObj->Starts == undef ){
$self->TicketObj->SetStarts( $now->ISO );
}
if ( $self->TicketObj->Started == undef ){
$self->TicketObj->SetStarted( $now->ISO );
}
if ( $self->TicketObj->Due == undef ){
$self->TicketObj->SetDue( $sla->ISO );
}
return 1;
How can I test if user already fill these fields?
Thanks
Cristiano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20060201/48134bd6/attachment.htm>
More information about the rt-users
mailing list