Custom Scrip for ticket move

View: New views
4 Messages — Rating Filter:   Alert me  

Custom Scrip for ticket move

by Juan N. DLC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
 

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


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

Re: Custom Scrip for ticket move

by Emmanuel Lacour :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...


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

Re: Custom Scrip for ticket move

by Juan N. DLC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, I will try to generate,

On Mon, Nov 2, 2009 at 9:15 AM, Emmanuel Lacour <elacour@...> 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@...


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


_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


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

Re: Custom Scrip for ticket move

by Juan N. DLC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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@...


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


_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


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