RT 4.0.4 - Running Extract Custom Fields script on existing tickets in queue?

All,

I finally got my ExtractCF working last night on incoming tickets to a
queue, what I would like to do is find a way to manually run that script
against the existing tickets in the queue (There’s about 2500). Is this
possible at all? Please advise. Thank you!

Chris

hello,
you can write your own perl script and launch it in a terminal.

inside your script you will search for all revelent tickets and apply your
modifications.

take a look at this script on how to initialize and search for tickets :
http://www.cs.kent.ac.uk/people/staff/tdb/rt3/rt-remind

Raphaël MOUNEYRES

“Chris Rios” CRios@hotwirecommunication.com
Envoyé par : rt-users-bounces@lists.bestpractical.com
18/01/2012 17:05

A
rt-users@lists.bestpractical.com
cc

Objet
[rt-users] RT 4.0.4 - Running Extract Custom Fields script on existing
tickets in queue?

All,

I finally got my ExtractCF working last night on incoming tickets to a
queue, what I would like to do is find a way to manually run that script
against the existing tickets in the queue (There’s about 2500). Is this
possible at all? Please advise. Thank you!

Chris
RT Training Sessions (http://bestpractical.com/services/training.html)

  • Boston — March 5 & 6, 2012

" Ce courriel et les documents qui lui sont joints peuvent contenir des
informations confidentielles ou ayant un caract�re priv�. S’ils ne vous sont
pas destin�s, nous vous signalons qu’il est strictement interdit de les
divulguer, de les reproduire ou d’en utiliser de quelque mani�re que ce
soit le contenu. Si ce message vous a �t� transmis par erreur, merci d’en
informer l’exp�diteur et de supprimer imm�diatement de votre syst�me
informatique ce courriel ainsi que tous les documents qui y sont attach�s."

" This e-mail and any attached documents may contain confidential or
proprietary information. If you are not the intended recipient, you are
notified that any dissemination, copying of this e-mail and any attachments
thereto or use of their contents by any means whatsoever is strictly
prohibited. If you have received this e-mail in error, please advise the
sender immediately and delete this e-mail and all attached documents
from your computer system."

I finally got my ExtractCF working last night on incoming tickets to a queue, what I would
like to do is find a way to manually run that script against the existing tickets in the queue
(There’s about 2500). Is this possible at all? Please advise. Thank you!

You can use rt-crontool --transaction first --action
ExtractCustomFieldValues --template yourtemplate --search (find the
tickets you want to touch) to execute an existing action/template
across existing tickets.

You’ll of course want to test on a development instance first

-kevin

Chris,

If this is about getting a lot of older tickets caught up with the values
they didn’t get, have you considered using “Bulk Update”?

Of course, you would have to be able to single these tickets out by some
other existing data.

KennOn Wed, Jan 18, 2012 at 8:04 AM, Chris Rios CRios@hotwirecommunication.comwrote:

All,****


I finally got my ExtractCF working last night on incoming tickets to a
queue, what I would like to do is find a way to manually run that script
against the existing tickets in the queue (There’s about 2500). Is this
possible at all? Please advise. Thank you!****


Chris****



RT Training Sessions (http://bestpractical.com/services/training.html)

  • Boston — March 5 & 6, 2012

Thanks Kevin,

One more question… I have my syntax as follows… most of the tickets in
this queue are in a stalled status, but I want to update all of them, but it
doesn’t seem to be doing that:

./rt-crontool --transaction first --action
RT::Action::ExtractCustomFieldValues --template CustomFieldExtract --search
RT::Search::ActiveTicketsInQueue --search-arg "Status=‘stalled’ and
Queue=‘Copyright_Notices’

The Search::ActiveTicketsInQueue only seems to pick up open tickets, and not
ones in a “new” or “stalled” status. Any thoughts?

Kevin Falcone-2 wrote:

I finally got my ExtractCF working last night on incoming tickets to a
queue, what I would
like to do is find a way to manually run that script against the
existing tickets in the queue
(There’s about 2500). Is this possible at all? Please advise. Thank
you!

You can use rt-crontool --transaction first --action
ExtractCustomFieldValues --template yourtemplate --search (find the
tickets you want to touch) to execute an existing action/template
across existing tickets.

You’ll of course want to test on a development instance first

-kevin


RT Training Sessions (http://bestpractical.com/services/training.html)

  • Boston — March 5 & 6, 2012

View this message in context: http://old.nabble.com/RT-4.0.4---Running-Extract-Custom-Fields-script-on-existing-tickets-in-queue--tp33162202p33164952.html

./rt-crontool --transaction first --action
RT::Action::ExtractCustomFieldValues --template CustomFieldExtract --search
RT::Search::ActiveTicketsInQueue --search-arg "Status=‘stalled’ and
Queue=‘Copyright_Notices’

The Search::ActiveTicketsInQueue only seems to pick up open tickets, and not
ones in a “new” or “stalled” status. Any thoughts?

Use RT::Search::FromSQL and keep the same --search-arg.

One more question… I have my syntax as follows… most of the tickets in
this queue are in a stalled status, but I want to update all of them, but it
doesn’t seem to be doing that:

./rt-crontool --transaction first --action
RT::Action::ExtractCustomFieldValues --template CustomFieldExtract --search
RT::Search::ActiveTicketsInQueue --search-arg "Status=‘stalled’ and
Queue=‘Copyright_Notices’

ActiveTicketInQueue takes a --search-arg of the queue name, not a
status. You’re attempting to hand it syntax for the FromSQL Search
type.

-kevin

Fantastic! That did the trick. Thank you for your help, Thomas and Kevin!

Thomas Sibley wrote:

./rt-crontool --transaction first --action
RT::Action::ExtractCustomFieldValues --template CustomFieldExtract
–search
RT::Search::ActiveTicketsInQueue --search-arg "Status=‘stalled’ and
Queue=‘Copyright_Notices’

The Search::ActiveTicketsInQueue only seems to pick up open tickets, and
not
ones in a “new” or “stalled” status. Any thoughts?

Use RT::Search::FromSQL and keep the same --search-arg.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Boston March 5 & 6, 2012

View this message in context: http://old.nabble.com/RT-4.0.4---Running-Extract-Custom-Fields-script-on-existing-tickets-in-queue--tp33162202p33165016.html