Re-set date field

To List,

I’m not a real experienced Perl guy and I want to write a scrip that will
re-set a date field to nulls or blank or whatever a date field can be set to
for NO date at all. I’m doing this for tickets that are re-opened. I’ve got
the condition set OK. Just stuck on the command to set a date to nothing.
Thanks.

Kenn
LBNL

I’m not a real experienced Perl guy and I want to write a scrip that will re-set a date field
to nulls or blank or whatever a date field can be set to for NO date at all. I’m doing this
for tickets that are re-opened. I’ve got the condition set OK. Just stuck on the command to
set a date to nothing.

0 should be fine, depends on how you’re setting the date

-kevin

Kevin,

The code doesn’t blow up (with a simple 0), but I get 1970 on all my search
results. I need to get rid of that somehow. Any ideas? Thanks.

Kenn
LBNLOn Fri, Aug 27, 2010 at 9:39 AM, Kevin Falcone falcone@bestpractical.comwrote:

On Wed, Aug 25, 2010 at 12:09:49PM -0700, Kenneth Crocker wrote:

I’m not a real experienced Perl guy and I want to write a scrip that
will re-set a date field
to nulls or blank or whatever a date field can be set to for NO date
at all. I’m doing this
for tickets that are re-opened. I’ve got the condition set OK. Just
stuck on the command to
set a date to nothing.

0 should be fine, depends on how you’re setting the date

-kevin

RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year – Learn how to get the most out of RT!

The code doesn’t blow up (with a simple 0), but I get 1970 on all my search results. I need to
get rid of that somehow. Any ideas? Thanks.

 0 should be fine, depends on how you're setting the date

The key part of my statement is “Depends on how you’re setting the
date”

-kevin

Kevin,

I don’t understand. The CF is a “Select date” and th3e code is as follows:

re-set the CF “Work-Completed Date” if it exists

my $ticket = $self->TicketObj;
my $trans = $self->TransactionObj;
my $cf_obj = RT::CustomField->new($RT::SystemUser);
my $new_value = 0;
my $cf_name = “Work-Completed Date”;
my $Completed_Date = $ticket->FirstCustomFieldValue(‘Work-Completed Date’);

if ($Completed_Date)
{
$cf_obj->LoadByName(Name=>$cf_name);
$RT::Logger->debug(“Loaded$cf_obj->Name = “. $cf_obj->Name() .”\n”);
$ticket->AddCustomFieldValue(Field=>$cf_obj, Value=>$new_value,
RecordTransaction=>0);
}

I’m not sure what it is I should do differently.

Thanks.

Kenn
LBNLOn Mon, Aug 30, 2010 at 9:57 AM, Kevin Falcone falcone@bestpractical.comwrote:

On Mon, Aug 30, 2010 at 09:15:17AM -0700, Kenneth Crocker wrote:

The code doesn’t blow up (with a simple 0), but I get 1970 on all my
search results. I need to
get rid of that somehow. Any ideas? Thanks.

 0 should be fine, depends on how you're setting the date

The key part of my statement is “Depends on how you’re setting the
date”

-kevin

RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year – Learn how to get the most out of RT!

I don’t understand. The CF is a “Select date” and th3e code is as follows:

Kenn

You said ‘date field’ so I assumed you meant Due or another built in
RT date field. Since you’re running an experimentally patched RT, I’m
not sure how you should do what you want.

-kevin