Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Users

Custom Scrip for ticket move

 

 

Request Tracker users RSS feed   Index | Next | Previous | View Threaded


juann.dlc at gmail

Oct 28, 2009, 6:02 AM

Post #1 of 4 (638 views)
Permalink
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


elacour at easter-eggs

Nov 2, 2009, 5:15 AM

Post #2 of 4 (563 views)
Permalink
Re: Custom Scrip for ticket move [In reply to]

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


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


juann.dlc at gmail

Nov 3, 2009, 5:21 AM

Post #3 of 4 (552 views)
Permalink
Re: Custom Scrip for ticket move [In reply to]

Thanks, I will try to generate,

On Mon, Nov 2, 2009 at 9:15 AM, Emmanuel Lacour <elacour [at] easter-eggs>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
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>


juann.dlc at gmail

Nov 9, 2009, 11:52 AM

Post #4 of 4 (497 views)
Permalink
Re: Custom Scrip for ticket move [In reply to]

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>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
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>

Request Tracker users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.