[rt-users] Default Time Worked

Mathew Snyder theillien at yahoo.com
Tue Jun 26 11:03:19 EDT 2007


Edge, Sean wrote:
> 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
> 

I've clarified with my boss.  He does want the field to be pre-populated.
Fortunately, the local directory supports the .pm files as well.  I'll have to
tinker to find the solution.  However, if anyone has any thoughts on where I
should change this I'd appreciate it.

Mathew



More information about the rt-users mailing list