[rt-users] Default Time Worked

Edge, Sean Sean.Edge at mtvnmix.com
Tue Jun 26 10:46:46 EDT 2007


Mathew,
----------
It isn't working.  This is how I've configured it:
Description: Default Time Worked
Condition: On Create
Action: User Defined
Template: Global template: Transaction
Stage: TransactionCreate
----------

I generally use a Blank template so there's no correspondance sent when
making a change like this.

----------
Custom Condition: $self->TicketObj->SetTimeWorked(5);
Custom action preparation code:
Custom action cleanup code: return 1;
----------

This is already using an "On Create" condition so you should just put
"return 1;" in that box and move the code to the "action preparation
code".

----------
I'm wondering though, by using SetTimeWorked(5), won't I just be setting
the time to 5 regardless of the value entered in the field during a
comment or reply?
----------

The condition is set to "On Create" so it will only happen when a new
ticket is created.

----------
I think what would be preferable in the situation I'm looking at is to
have the value of the field automatically set on the comment/reply
screen rather than have the addition made upon transaction creation.
This is what I meant by a default.  Rather than present the user with a
blank field to have it populated with "5" and allow them to alter it as
necessary.
----------

You could (probably should) put a check in that Scrip to see if
TimeWorked has already been set so if someone has created a ticket with
TimeWorked it's not automatically overwritten.

The only way I could think to have the "Time Worked" field automatically
filled would be to modify the RT code or db schema, neither of which I
would recommend.

-Sean



This email (including any attachments) is for its intended-recipient's
use only. This email may contain information that is confidential or
privileged.  If you received this email in error, please immediately
advise the sender by replying to this email and then delete this message
from your system.  For further information and disclaimers that apply to
this email, see [http://www.viacom.com/email_disclaimer.jhtml].



More information about the rt-users mailing list