[rt-users] automatically set due date and priority based on custom field

Eric Horne eric.horne at teradyne.com
Fri Dec 16 14:51:55 EST 2005

I've set the due date based on a due date embedded into the request. If 
the user says "DateDue: Feb 28, 2006 2:00" it'll set the duedate to that 
specified date.

It's not exactly what you are asking for, but maybe it helps get you 
started. I think there is some date manipulation you can perform within 
WebRT via the RT::Date class.


Condition: On Create
Template: Blank

my $AttachObj = $self->TransactionObj->Attachments->First;
# go out if content is not text!
unless( $AttachObj->ContentType =~ /^text/ ) {
      return 1;

my $content = $AttachObj->Content;

if ($content =~ m/^\QDate-Due:\E\s*([-0-9\:\s]+[0-9])\s*$/m) {
       $self->TicketObj->_Set(Field => "Due", Value => $1);

Matt Nichols wrote:
> Hello,
> I'd like to automatically set the due date and priority of new tickets 
> based on a users selection of the custom field 'severity'. The creation 
> of the custom field 'severity' was the easy part. My understanding is 
> that the automatic setting of due date and priority based on this custom 
> field can be accomplished with a scrip. Has anyone done anything similar 
> to this?
> Thanks.
> -Matt
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
> Download a free sample chapter of RT Essentials from O'Reilly Media at 
> http://rtbook.bestpractical.com
> WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
> San Francisco - Find out more at 
> http://bestpractical.com/services/training.html

More information about the rt-users mailing list