[rt-users] Custom Scrip for ticket move

Juan N. DLC juann.dlc at gmail.com
Mon Nov 9 14:52:58 EST 2009


I can't get this to work. Coould you give me a hand?
thanks

On Mon, Nov 2, 2009 at 9:15 AM, Emmanuel Lacour <elacour at easter-eggs.com>wrote:

>  On Wed, Oct 28, 2009 at 09:02:09AM -0400, Juan N. DLC wrote:
> > Hi to all,
> >
> > I want to know if someone have a scrip that make a ticket get the
> priority
> > and duedate from the queue is moving to.
> >
> > ej.
> >
> > Ticket#001 in queue#1 with duedate 1/priority 3
> >
> > Ticket#001 have now a dudedate1 and priority 3
> >
> > when the Ticket#001 is moved to queue#2 with duedate 3 / priority 1 - The
> > ticket still have the queue#1 duedate/priority settings.
> >
> > Can some one be so kind to point me to the right direction here or can
> give
> > me a scrip for this.
> >
>
> You have to create a scrip "On queue change", in this scrip, get the new
> queue
>
> something like this:
>
> my $queue_id = $self->TransactionObj->NewValue;
> my $queue = RT::Queue->new( $RT::SystemUser );
> $queue->Load($queue_id);
>
> get values for duedate and priority:
>
> $queue->DefaultDueIn;
> $queue->InitialPriority;
>
> use those values to set them on the ticket:
>
> # Priority
> $self->TicketObj->SetPriority($queue->InitialPriority);
>
> # Due Date
> my $due_date = RT::Date->new($RT::SystemUser);
> $due_date->Set(Format => 'ISO', Value => $self->TicketObj->Due);
> $due_date->AddDays($queue->InitialPriority);
> $self->TicketObj->SetDue($due_date->ISO);
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20091109/d890cf3f/attachment.htm>


More information about the rt-users mailing list