Custom Scrip for ticket move

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.

Thanks

using RT 3.8.5

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);

Thanks, I will try to generate,On Mon, Nov 2, 2009 at 9:15 AM, Emmanuel Lacour elacour@easter-eggs.comwrote:

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);


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

I can’t get this to work. Coould you give me a hand?
thanksOn Mon, Nov 2, 2009 at 9:15 AM, Emmanuel Lacour elacour@easter-eggs.comwrote:

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);


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com