[rt-users] Date format to set Due Date with scrip?

Steven Platt Steven.Platt at hpa.org.uk
Thu May 20 08:28:41 EDT 2010


Hi,

The config setting 'Requests should be due in:' is not working, so I'm
trying to write a scrip to set the DueDate on ticket creation. I'm on RT
v3.6.2 and don't want to upgrade just for this issue.

Following advice on the wiki I've got the following


Condition: 	On Create
Action:		user defined
Template:	Global template: blank

Custom action prep code:	1;
Custom action cleanup code:

use Date::Calc qw(:all);

($year,$month,$day) = Today([$gmt]);
($year2,$month2,$day2) = Add_Delta_Days($year,$month,$day,"7");
$string = Date_to_Text($year2,$month2,$day2);
$lower = ISO_LC($string);
$self->TicketObj->SetDue($lower);


Due Date is not set though :-(

Running this on command line, $lower prints a date formatted as 'thu
27-may-2010'
I can hack around with the date format if someone can tell me what it
should be so that RT will accept it into the database (postgres).

Thanks

Steve

Dr Steven Platt
Bioinformatician
Health Protection Agency
Centre for Infections
London
www.hpa.org.uk/bioinformatics



-----------------------------------------
**************************************************************************
The information contained in the EMail and any attachments is
confidential and intended solely and for the attention and use of
the named addressee(s). It may not be disclosed to any other person
without the express authority of the HPA, or the intended
recipient, or both. If you are not the intended recipient, you must
not disclose, copy, distribute or retain this message or any part
of it. This footnote also confirms that this EMail has been swept
for computer viruses, but please re-sweep any attachments before
opening or saving. HTTP://www.HPA.org.uk
**************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100520/6bc1b714/attachment.htm>


More information about the rt-users mailing list