I have a scrip that uses the Action: Create Tickets. When the child ticket is created I need to populate some custom fields using data from the parent.
Fetching the data from the parent ticket is no problem but I cannot figure out how to AddCustomFieldValue to the child ticket.
-Ticket in Queue-A is created or modified.
-A scrip configured with a User Defined Condition checks the values of a few fields. If the correct conditions exist, the condition ‘returns 1’ and the Action: Create Tickets is triggered, using a specific Template.
-Template sets the Subject and Body of the Child Ticket.
I’ve tried using the Template to populate fields but it appears Templates can only fetch/display data, they cannot modify Custom Fields. Somebody please correct me if I’m wrong about that.
So far all I can think to do is stop using the built-in Create Tickets Action and instead write a custom Action that creates the child, grabs the child ticket ID, then modifies the field.
Trying to add anything like this to the template prevents the child ticket from being created. So far I’m not seeing any errors in the log.
{$self->TicketObj->AddCustomFieldValue( Field => ‘username’, Value => “victory”)}
I think I’ll try creating the child ticket manually so I can get its id and modify it that way. I haven’t found any examples of someone using AddCustomFieldValue in a Template which makes me think it isn’t actually possible.