[rt-users] Setting Time Worked as Mandatory Field

Dave Wells dave.wells at foreshore.net
Thu Sep 24 09:00:20 EDT 2009


Hi Guys,

I know this has been brought up a couple of times on the lists, but
can't find anything that seems to work for me.

What I am looking for is a way to stop tickets being resolved if there
is no time worked set.

I have seen a post where Richard Ellis stated that adding this to your
/path/to/rt3/local/html/Ticket/Update.html this would work exactly as I
would wish, however I am not entirely sure of how this file should be
formatted, I understand that the files in /local/ should append to those
in /share/:

if ($DefaultStatus eq 'resolved') {
     # if we are resolving a ticket and there has been no time
submitted,
     # do not allow the ticket to resolve.  must check that SubmitTicket
is
     # set, or we prevent the close page from loading and thus NO ticket
can
     # be resolved.
     if ((! defined($TicketObj->TimeWorked) or $TicketObj->TimeWorked ==

0) and
         $ARGS{'UpdateTimeWorked'} <= 0 and
         exists $ARGS{'SubmitTicket'} ) {
         Abort("You cannot resolve a ticket with zero time worked. 
Please reselect the ticket and try again");
     }


When I add this file and insert the above text by itself, when I try and
update a ticket it mearly prints the above code out on the webpage,
obviously I am missing some tags or code.

If someone could enlighten me that would be great.

Many Thanks.

Dave




More information about the rt-users mailing list