AddAdminCcAndChangeQueue: Difference between revisions
Jump to navigation
Jump to search
m (2 revisions imported) |
mNo edit summary |
||
Line 1: | Line 1: | ||
On a queue with several admin[[CCs]] there was one slightly different task that needed to included one other person. Rather than create a second queue with its own list of Admin CC's and require everyone to watch two queues we made a second queue and added this script to move the tickets to the main queue. The web form for the special jobs routes them to the special queue, where the script adds the adminCC and changes the assigned queue to the main queue. | On a queue with several admin[[CCs]] there was one slightly different task that needed to included one other person. Rather than create a second queue with its own list of Admin CC's and require everyone to watch two queues we made a second queue and added this script to move the tickets to the main queue. The web form for the special jobs routes them to the special queue, where the script adds the adminCC and changes the assigned queue to the main queue. | ||
< | <pre> | ||
Description: AddAdminCC and change queue | |||
Condition: On Create | Condition: On Create | ||
Action: User Defined | Action: User Defined | ||
Line 29: | Line 30: | ||
} | } | ||
return 1; | return 1; | ||
</pre> |
Latest revision as of 19:50, 13 August 2016
On a queue with several adminCCs there was one slightly different task that needed to included one other person. Rather than create a second queue with its own list of Admin CC's and require everyone to watch two queues we made a second queue and added this script to move the tickets to the main queue. The web form for the special jobs routes them to the special queue, where the script adds the adminCC and changes the assigned queue to the main queue.
Description: AddAdminCC and change queue Condition: On Create Action: User Defined Template: Global Template: Admin Comment Stage: Transaction Create Custom Action Prep Code: return 1; Custom Action Cleanup Code: # add adminCC my $admincclist = $self->TicketObj->AdminCc; my $user = RT::User->new($RT::SystemUser); $user->LoadByEmail('somebody@somewhere.com'); $admincclist->AddMember($user->Id); # Change queue my $newqueue = "some_queue_number"; my $T_Obj = $self->TicketObj; $RT::Logger->info("Auto assign ticket #". $T_Obj->id ." to queue #". $newqueue ); my ($status, $msg) = $T_Obj->SetQueue($newqueue); unless ($status) { $RT::Logger->warning("unable to set new queue: $msg"); return undef; } return 1;