[rt-users] re-set date field

Kevin Falcone falcone at bestpractical.com
Mon Aug 30 14:59:52 EDT 2010


On Mon, Aug 30, 2010 at 11:23:21AM -0700, Kenneth Crocker wrote:
>    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

>    # 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
>    LBNL
> 
>    On Mon, Aug 30, 2010 at 9:57 AM, Kevin Falcone <[1]falcone at bestpractical.com> wrote:
> 
>      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!
> 
> References
> 
>    Visible links
>    1. mailto:falcone at bestpractical.com

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100830/a4becc4c/attachment.sig>


More information about the rt-users mailing list