[rt-users] Hours Worked

Greg Evans gevans at hcc.net
Fri Feb 8 13:26:46 EST 2008


Hello,

I am trying to work on this time worked issue myself and have been trying
the following:

Condition: On Transaction
Action: user defined
Template: Global template: Blank
Stage: TransactionCreate

Custom Condition: <blank>
Custom action preparation code: 
1;

Custom action cleanup code:
$ticket_Worked = ($self->TicketObj->Updated - $self->TicketObj->Created);
if ($self->TicketObj->Type eq "Correspond" || $self->TicketObj->Type eq
"Comment")
{ 
     $self->TicketObj->SetTimeWorked ($ticket_Worked);
}
else {
return 0;
}



Can someone tell me if that looks even remotely correct?  I know that Mike
has said that we might need to convert times to Unix time and then back
again, and I haven't tried that yet, but I also have not even got to see any
kind of data go into that field. I was thinking that I might be able to put
whatever is returned into a comment or something as well to see if that
would work, so I changed the $self->TicketObj->SetTimeWorked to
$self->TicketObj->setContent, but I also had nothing returned that I could
see.

Not really sure where to go from there, hoping that someone has some insight
for me (or even a small clue)

Greg Evans

 

> -----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com 
> [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf 
> Of Mike Peachey
> Sent: Friday, February 08, 2008 12:24 AM
> To: Chaitanya Veludandi; rt-users at lists.bestpractical.com
> Subject: Re: [rt-users] Hours Worked
> 
> Chaitanya Veludandi wrote:
>  > Hi,
>  >
>  > Is there a way to calculate Hours Worked (using Business 
> Hours) based on
>  > the difference betwee Resolved Time and Created Time and 
> then move it to
>  > a custom Field?
> 
> 
> Posted to this list less than 24 hours ago:
> 
[snip]




More information about the rt-users mailing list