- #prepare our action
- my $action_obj = $action->new(
- TicketObj => $ticket,
- TransactionObj => $transaction,
- TemplateObj => $template_obj,
- Argument => $action_arg,
- ScripObj => $void_scrip,
- ScripActionObj => $void_scrip_action,
- CurrentUser => $CurrentUser,
- );
+ my $i = 0;
+ for my $action (@$actions) {
+
+ # Given the current index of the actions array, see
+ # if there is still a corresponding element in the
+ # actions_arg array. If so, then use that argument,
+ # else use undef.
+ my $action_argument = ($i <= $#$actions_arg) ? $actions_arg->[$i] : undef;
+ $i++;
+
+ # prepare our action
+ my $action_obj = $action->new(
+ TicketObj => $ticket,
+ TransactionObj => $transaction,
+ TemplateObj => $template_obj,
+ Argument => $action_argument,
+ ScripObj => $void_scrip,
+ ScripActionObj => $void_scrip_action,
+ CurrentUser => $CurrentUser,
+ );