QuickCalls extension limiting by group in RT5?

Hello!

My organization has recently implemented the QuickCalls extension to our version of RT5 (5.0.2 specifically). We were looking into limiting some QuickCalls to members of certain groups and we came across this post:

However, this is for RT4. When I tried to implement it in RT5, it would either not limit the QuickCalls or break the extension completely. I will be completely honest, my Perl skills are very minimal so that also doesn’t help either. Is there a section from that post that I need to change or look into that is different in RT5 vs. RT4?

Any tips or ideas would be helpful, thanks!

Not tried it myself but try this in your equivalent of /opt/rt5/local/plugins/RT-Extension-QuickCalls/html/Elements/QuickCalls :

<&| /Widgets/TitleBox, title => loc('Quick Calls') &>
<div class="form-row">
  <div class="col-auto">
    <form method="post"
          action="<%$RT::WebPath%>/Helpers/QuickCalls">
    <select name="QuickCall" class="selectpicker form-control">
%     foreach my $QuickCall (@{$RT::QuickCalls||[]}) {
%       if($QuickCall->{‘Groups’}) {
%       my $allow = 0;
%       my $groupObj = new RT::Group( $session{CurrentUser} );
%       my $principalId = $session{CurrentUser}->Id;
%       foreach my $groupName (@{$QuickCall->{‘Groups’}}) {
%         $groupObj->LoadUserDefinedGroup($groupName);
%           if($groupObj && $groupObj->HasMemberRecursively($principalId)) {
%             $allow = 1;
%             last;
%           }
%         }
%         next if(!$allow);
%       }
      <option value="<%$QuickCall->{Name}%>"><%$QuickCall->{Name}%>
%     }
    </select>
  </div>
  <div class="col-auto">
    <& /Elements/Submit, Name => 'SubmitTicket', Label => loc('Create') &>
  </div>
</div>
</form>
</&>