Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $cfv = $self->TransactionObj->CreatorObj->FirstCustomFieldValue('Client');
- my $groups = $self->TransactionObj->CreatorObj->OwnGroups;
- my ($princ_id, $group_principalobj);
- while(my $group = $groups->Next) {
- if($cfv eq $group->Name) {
- $princ_id = $group->id;
- $group_principalobj = $group->PrincipalObj;
- }
- }
- my ($status, $msg) = $self->TicketObj->AddWatcher(Type => 'Cc', PrincipalId => $princ_id);
- unless ( $status ) {
- $RT::Logger->error("Couldn't add watcher to $princ_id: $msg");
- return 0;
- }
- ($status, $msg) = $group_principalobj->GrantRight(
- Object => $self->TicketObj,
- Right => 'ShowTicket'
- );
- unless ( $status ) {
- $RT::Logger->error("Couldn't add ShowTicket to $group_principalobj->id: $msg");
- return 0;
- }
- return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement