[rt-users] Spawn multiple child tickets

Kevin Falcone falcone at bestpractical.com
Thu Jun 3 11:54:05 EDT 2010


On Wed, Jun 02, 2010 at 11:59:38AM -0700, Jonathan Rummel wrote:
> 
> Thank you, Bill.  I will definitely use that to try and get it to work.

Jonathan

Your condition only checks if the first value is Florida and then
again hardcodes the first value into the ticket creation.  Using
FirstCustomFieldValue is never going to show you the second value.

CreateTickets can create multiple tickets by defining them in the
Template with differing ===Create-Ticket: lines (see the pod in the
action) but that requires you to know how many tickets you want.

I believe in the past people have advised that you either write a look
that calls Ticket->Create for each CustomFieldValue, but you should be
able to generate the template entirely within {} for each
CustomFieldValue if you want to go that route.

-kevin

> The scrips I wrote look like this:
> 
> Condition: User Defined
> Action: Create Tickets
> Template: Create Child Ticket
> Stage: TransactionCreate
> 
> 
> Custom condition:
> my $trans = $self->TransactionObj;
> my $ticket = $self->TicketObj;
> 
> if ($trans->Type eq 'Create' && $ticket->FirstCustomFieldValue('State') eq
> 'Florida') {
>      return 1;
> }
> 
> return 0;
> 
> 
> TEMPLATE:
> 
> ===Create-Ticket: flchild
> Subject: {$Tickets{'TOP'}->Subject}
> ({$Tickets{'TOP'}->FirstCustomFieldValue('State')})
> Depended-On-By: {$Tickets{'TOP'}->Id()}
> Owner: jrummel
> Requestor: {$Tickets{'TOP'}->Creator}
> InitialPriority: {$Tickets{'TOP'}->Priority}
> Queue: Test Queue
> Content: This is a child ticket automatically created from ticket
> #{$Tickets{'TOP'}->Id()}.
> ENDOFCONTENT
> 
> 
> Please let me know if you need any more info to move on from here.  Thanks!
> 
> 
> 
> Jonathan Rummel wrote:
> > 
> > Hi everyone,
> > 
> > This is driving me crazy, so PLEASE, any help at all is greatly
> > appreciated.  Is there a way to have multiple child tickets created based
> > on a Select Multiple custom field?
> > 
> > Example:
> > 
> > Someone selects "Florida" and "Pennsylvania" in the "State" custom field. 
> > I would like this to create 2 tickets that depend on this ticket when the
> > user clicks 'Save Changes' (if updating ticket) or 'Create' (if creating
> > new ticket).  One for Florida, and one for Pennsylvania.
> > 
> > Is there a way to make this happen?  Is this a clear enough description?
> > 
> > Thanks again!
> > Jonathan
> > 
> > RT 3.6.5, MySQL
> > 
> 
> -- 
> View this message in context: http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28758625.html
> Sent from the Request Tracker - User mailing list archive at Nabble.com.
> 
> 
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100603/f3eb1295/attachment.sig>


More information about the rt-users mailing list