Hi Eric,
I have created a custom field ‘severity’ where users can select a
severity level (for example severity levels 1-4) when creating a new
ticket. I would like to automatically assign predefined due dates and
priority levels based on the selection from the ‘severity’ field.
For example:
Severity 1 - Due 1 hour from now - Priority W
Severity 2 - Due 4 hours from now - Priority X
Severity 3 - Due 8 hours from now - Priority Y
Severity 4 - Due 24 hours from now - Priority Z
Thanks for the example code.
-Matt
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Eric
HorneSent: Friday, December 16, 2005 1:52 PM
To: rt-users
Subject: Re: [rt-users] automatically set due date and priority based on
customfield
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.
-eric
Condition: On Create
Template: Blank
Action:
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
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
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