Spawn multiple child tickets

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-tp28755908p28755908.html

Jonathan,

The only thing I have seen is in the “Bulk Update” the ability to addlinks.
But that entails tickets (parent/child) already existing and you want to
link them. The only thing I can suggest is to create a scrip for this
function. I believe there were a couple out there for something similar to
this before 3.8.X came out with a built-in create link in the Ticket page.
Perhaps you could copy one of those and modify it to meet your needs. Just a
thought.

Kenn
LBNLOn Wed, Jun 2, 2010 at 8:13 AM, Jonathan Rummel jrummel@imapp.com 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-tp28755908p28755908.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

Thanks for the response, Kenn. I definitely think I’m going to have to write
a scrip, but that’s where I’m kind of stumped. I wrote multiple scrips (one
that creates a child ticket for Florida when it is selected, one for
Pennsylvania when it is selected, etc.), and they work individually but when
multiple states are selected, only 1 child ticket is created and it’s always
the first option selected. Does anyone have any thoughts on this?

Jonathan,

The only thing I have seen is in the “Bulk Update” the ability to addlinks.
But that entails tickets (parent/child) already existing and you want to
link them. The only thing I can suggest is to create a scrip for this
function. I believe there were a couple out there for something similar to
this before 3.8.X came out with a built-in create link in the Ticket page.
Perhaps you could copy one of those and modify it to meet your needs. Just a
thought.

Kenn
LBNL

View this message in context: http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28757865.html

Jonathan,

To help, I’d need to see your scrips and know what version you’re on. I
haven’t done a scrip to create children, but I think I can look at some
others and help figure them out with you.

Kenn
LBNLOn Wed, Jun 2, 2010 at 10:54 AM, Jonathan Rummel jrummel@imapp.com wrote:

Thanks for the response, Kenn. I definitely think I’m going to have to
write
a scrip, but that’s where I’m kind of stumped. I wrote multiple scrips
(one
that creates a child ticket for Florida when it is selected, one for
Pennsylvania when it is selected, etc.), and they work individually but
when
multiple states are selected, only 1 child ticket is created and it’s
always
the first option selected. Does anyone have any thoughts on this?

Jonathan,

The only thing I have seen is in the “Bulk Update” the ability to addlinks.
But that entails tickets (parent/child) already existing and you want to
link them. The only thing I can suggest is to create a scrip for this
function. I believe there were a couple out there for something similar to
this before 3.8.X came out with a built-in create link in the Ticket page.
Perhaps you could copy one of those and modify it to meet your needs. Just
a
thought.

Kenn
LBNL


View this message in context:
http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28757865.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

Hi,

There is a scrip for doing something close to this on the wiki (
http://wiki.bestpractical.com). Have a look there.

Actually, I remembered it being named something that most wouldn’t search
for so here is the link: http://wiki.bestpractical.com/view/Workflow

Thanks,
BillOn Wed, Jun 2, 2010 at 10:54, Jonathan Rummel jrummel@imapp.com wrote:

Thanks for the response, Kenn. I definitely think I’m going to have to
write
a scrip, but that’s where I’m kind of stumped. I wrote multiple scrips
(one
that creates a child ticket for Florida when it is selected, one for
Pennsylvania when it is selected, etc.), and they work individually but
when
multiple states are selected, only 1 child ticket is created and it’s
always
the first option selected. Does anyone have any thoughts on this?

Jonathan,

The only thing I have seen is in the “Bulk Update” the ability to addlinks.
But that entails tickets (parent/child) already existing and you want to
link them. The only thing I can suggest is to create a scrip for this
function. I believe there were a couple out there for something similar to
this before 3.8.X came out with a built-in create link in the Ticket page.
Perhaps you could copy one of those and modify it to meet your needs. Just
a
thought.

Kenn
LBNL


View this message in context:
http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28757865.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

Bill Graboyes
On Assignment At:
Toyota Motor Sales, USA, Inc.
Consumer Portal Delivery
Office: (310) 468-6754
Cell: (714) 515-8312

Thank you, Bill. I will definitely use that to try and get it to work.

Kenn,

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
({$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

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

Thanks, Kevin. I’m pretty much doing this on a novice level, and could use a
little more explaining if possible. Please see notes in caps and
parenthesis below:

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.

(HOW DO I REFERENCE THE 2ND, 3RD, ETC. CUSTOM FIELD VALUES IN MY CONDITION?
I DON’T SUPPOSE IT’S AS EASY AS “SecondCustomFieldValue”.)

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.

(COULD YOU PLEASE EXPLAIN THE ABOVE FURTHER? I’M NOT SURE I COMPLETELY
UNDERSTAND.)

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

View this message in context: http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28832522.html

Jonathan,

If I understand this right, you want to create a child ticket for every
value the user selects in the Custom Field. If they choose Florida and
Maine, then you want two child tickets. If they select Florida, you want
one. What if they select 3 or 4 values? If this is the case, I would create
a scrip for each possible value, that way, no matter how many they select,
each one will create a child ticket.

Kenn
LBNLOn Wed, Jun 9, 2010 at 9:10 AM, Jonathan Rummel jrummel@imapp.com wrote:

Thanks, Kevin. I’m pretty much doing this on a novice level, and could use
a
little more explaining if possible. Please see notes in caps and
parenthesis below:

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.

(HOW DO I REFERENCE THE 2ND, 3RD, ETC. CUSTOM FIELD VALUES IN MY CONDITION?
I DON’T SUPPOSE IT’S AS EASY AS “SecondCustomFieldValue”.)

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.

(COULD YOU PLEASE EXPLAIN THE ABOVE FURTHER? I’M NOT SURE I COMPLETELY
UNDERSTAND.)

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


View this message in context:
http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28832522.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

That’s correct, Kenn. If they select 3 values, I want 3 child tickets and so
on. However, that’s my main problem. I’ve done what you’re suggesting (by
using the code I provided, with one scrip for each state), and it only
creates a child ticket for the first option selected. Any ideas?

Jonathan

Kenneth Crocker wrote:

Jonathan,

If I understand this right, you want to create a child ticket for every
value the user selects in the Custom Field. If they choose Florida and
Maine, then you want two child tickets. If they select Florida, you want
one. What if they select 3 or 4 values? If this is the case, I would
create
a scrip for each possible value, that way, no matter how many they select,
each one will create a child ticket.

Kenn
LBNL

Thanks, Kevin. I’m pretty much doing this on a novice level, and could
use
a
little more explaining if possible. Please see notes in caps and
parenthesis below:

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.

(HOW DO I REFERENCE THE 2ND, 3RD, ETC. CUSTOM FIELD VALUES IN MY
CONDITION?
I DON’T SUPPOSE IT’S AS EASY AS “SecondCustomFieldValue”.)

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.

(COULD YOU PLEASE EXPLAIN THE ABOVE FURTHER? I’M NOT SURE I COMPLETELY
UNDERSTAND.)

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


View this message in context:
http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28832522.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

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

View this message in context: http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28833645.html

Jonathan,

Try something like this:

Condition: User Defined
Action: Create Tickets
Template: Create Child Ticket
Stage: TransactionBatch

Custom Condition:

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “YOUR CF”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “Florida”)
{
return 1;
}
}

return 0;

That should create the ticket. I think you will need a different scrip for
notification purposes. One notification scrip should suffice for all the
tickets created.

Be sure to use TransactionBatch.

Hope this helps.

Kenn
LBNLOn Wed, Jun 9, 2010 at 10:41 AM, Jonathan Rummel jrummel@imapp.com wrote:

That’s correct, Kenn. If they select 3 values, I want 3 child tickets and
so
on. However, that’s my main problem. I’ve done what you’re suggesting (by
using the code I provided, with one scrip for each state), and it only
creates a child ticket for the first option selected. Any ideas?

Jonathan

Kenneth Crocker wrote:

Jonathan,

If I understand this right, you want to create a child ticket for every
value the user selects in the Custom Field. If they choose Florida and
Maine, then you want two child tickets. If they select Florida, you want
one. What if they select 3 or 4 values? If this is the case, I would
create
a scrip for each possible value, that way, no matter how many they
select,
each one will create a child ticket.

Kenn
LBNL

On Wed, Jun 9, 2010 at 9:10 AM, Jonathan Rummel jrummel@imapp.com wrote:

Thanks, Kevin. I’m pretty much doing this on a novice level, and could
use
a
little more explaining if possible. Please see notes in caps and
parenthesis below:

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.

(HOW DO I REFERENCE THE 2ND, 3RD, ETC. CUSTOM FIELD VALUES IN MY
CONDITION?
I DON’T SUPPOSE IT’S AS EASY AS “SecondCustomFieldValue”.)

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.

(COULD YOU PLEASE EXPLAIN THE ABOVE FURTHER? I’M NOT SURE I COMPLETELY
UNDERSTAND.)

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


View this message in context:

http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28832522.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

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


View this message in context:
http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28833645.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

Kenn,

You are awesome! It worked! TransactionBatch was the key. Thanks a
million!

Jonathan

Kenneth Crocker wrote:

Jonathan,

Try something like this:

Condition: User Defined
Action: Create Tickets
Template: Create Child Ticket
Stage: TransactionBatch

Custom Condition:

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “YOUR CF”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “Florida”)
{
return 1;
}
}

return 0;

That should create the ticket. I think you will need a different scrip for
notification purposes. One notification scrip should suffice for all the
tickets created.

Be sure to use TransactionBatch.

Hope this helps.

Kenn
LBNL

That’s correct, Kenn. If they select 3 values, I want 3 child tickets
and
so
on. However, that’s my main problem. I’ve done what you’re suggesting
(by
using the code I provided, with one scrip for each state), and it only
creates a child ticket for the first option selected. Any ideas?

Jonathan

Kenneth Crocker wrote:

Jonathan,

If I understand this right, you want to create a child ticket for every
value the user selects in the Custom Field. If they choose Florida and
Maine, then you want two child tickets. If they select Florida, you
want
one. What if they select 3 or 4 values? If this is the case, I would
create
a scrip for each possible value, that way, no matter how many they
select,
each one will create a child ticket.

Kenn
LBNL

Thanks, Kevin. I’m pretty much doing this on a novice level, and
could

use
a
little more explaining if possible. Please see notes in caps and
parenthesis below:

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.

(HOW DO I REFERENCE THE 2ND, 3RD, ETC. CUSTOM FIELD VALUES IN MY
CONDITION?
I DON’T SUPPOSE IT’S AS EASY AS “SecondCustomFieldValue”.)

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.

(COULD YOU PLEASE EXPLAIN THE ABOVE FURTHER? I’M NOT SURE I COMPLETELY
UNDERSTAND.)

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


View this message in context:

http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28832522.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

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


View this message in context:
http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28833645.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

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

View this message in context: http://old.nabble.com/Spawn-multiple-child-tickets-tp28755908p28843186.html