Skip to content

Commit

Permalink
Limit constituency to find the correct incident queue on create page
Browse files Browse the repository at this point in the history
Previously if you tried to create a new incident in some constituency, the
queue would wrongly default to the general "Incidents".
  • Loading branch information
sunnavy committed Dec 9, 2024
1 parent 03f8d24 commit 412ce38
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions html/RTIR/Incident/Create.html
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,15 @@
VALUE => RT::IR->lifecycle_incident,
);

if ($constituency) {
$queues->Limit(
FIELD => 'Name',
OPERATOR => 'ENDSWITH',
VALUE => "- $constituency",
CASESENSITIVE => 0,
);
}

while (my $object = $queues->Next) {
# Ensure the user can CreateTicket in the queue.
next unless $session{CurrentUser}->HasRight( Object => $object, Right => 'CreateTicket' );
Expand Down

0 comments on commit 412ce38

Please sign in to comment.