<%ARGS>
$Ticket
$Type
$Results
</%ARGS>

<%INIT>
if($Type eq 'Report' && !RT::IR::Ticket::IsLinkedToActiveIncidents($Ticket)) {
    $Ticket->Lock('Take');
    push @$Results, 'You have a lock on this report until you link it to an incident';
}
</%INIT>
