[Rt-commit] rtir branch, master, updated. 4.0.1rc1-135-g740736a0

? sunnavy sunnavy at bestpractical.com
Fri May 22 13:44:07 EDT 2020


The branch, master has been updated
       via  740736a02013297f7e8e5f3284501aaf37f9dcd6 (commit)
       via  3f17aed86151616fcc64d9c4c6f50c675b475c66 (commit)
       via  028c5d3d1dec47c590b2641de472db6b8fc71dea (commit)
       via  d3f311e9f05271eeba3926a432b4888093ae0cb4 (commit)
       via  b9c0370016ec56ecfad579f50b9f40cb7b6e22ab (commit)
       via  80fc158e823c5359eaf780e074eece8eab68acff (commit)
       via  05573899b094509d82d16d6b52c23cadc52665fd (commit)
       via  5e3ac6aa54ab4d4cd401c374d33b8ecc519d84c4 (commit)
       via  b9b3a8ed6b4b17a9e9f061ba61d932c56d81f714 (commit)
       via  9e1322ad5382252c6bde7bcba04e77c546cd60e7 (commit)
       via  83e7b7b7c4cdf5a7b35c06ac99c5d0545c33c9f8 (commit)
       via  ab4578df83d084494eb3453299d27590db50e802 (commit)
       via  b277514db24a424fb1c9504fae830a947f1b5224 (commit)
       via  3d84331dee8da381d7f418fa90819439b62bb4fb (commit)
       via  46bc61d47d63a0000062e8dbf69d7ab2d4aa0dd9 (commit)
       via  c89086f4690fafe0979603f261b39085d8712d88 (commit)
      from  1ca5748a421c1c3163bdf30e6844322adb4911b1 (commit)

Summary of changes:
 docs/UPGRADING-5.0                                 |  34 +++++
 html/Callbacks/RTIR/Elements/MakeClicky/Default    |   4 +-
 .../RTIR/Elements/RT__Ticket/ColumnMap/Once        |   2 +-
 html/Callbacks/RTIR/Elements/Tabs/Privileged       |  40 ++---
 html/RTIR/Create.html                              |  56 ++++---
 html/RTIR/CreateInQueue.html                       |   1 +
 html/RTIR/Elements/ShowIncidents                   |   2 +-
 html/RTIR/Helpers/CreateInRTIRQueueModal           |  49 ------
 html/RTIR/Incident/Create.html                     |  35 ++++-
 html/RTIR/Incident/Elements/ShowChildren           |   2 +-
 html/RTIR/Tools/Elements/LookupSummary             |   6 +-
 html/RTIR/Tools/index.html                         |   2 +-
 lib/RT/IR.pm                                       |   1 -
 lib/RT/IR/Test/Web.pm                              |  19 +--
 static/js/rtir.js                                  |  75 ----------
 t/002-test-reject.t                                |   8 +-
 t/009-attachments-processing.t                     |  10 +-
 t/020-incident-and-investigation.t                 |   1 -
 t/constituency/modal.t                             | 164 ---------------------
 t/constituency/queue_select.t                      | 153 +++++++++++++++++++
 t/custom-fields/defaults-on-linking.t              |   1 -
 t/incident/split.t                                 |   1 -
 22 files changed, 289 insertions(+), 377 deletions(-)
 create mode 100644 docs/UPGRADING-5.0
 delete mode 100644 html/RTIR/Helpers/CreateInRTIRQueueModal
 delete mode 100644 static/js/rtir.js
 delete mode 100644 t/constituency/modal.t
 create mode 100644 t/constituency/queue_select.t

- Log -----------------------------------------------------------------
commit c89086f4690fafe0979603f261b39085d8712d88
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu Mar 26 18:39:00 2020 -0500

    Restore RTIR menu into single parent
    
    This commit restores the menu structure from RTIR 3.2 where the
    RTIR options all live under a single parent.
    
    In addition to causing issues with other extensions that modify the
    menu, the expanded RTIR menus make accessing RT menu items more
    difficult.  The RTIR items each only contain a single entry to
    create a ticket compared to the RT menu items which contain more
    options and sub menus.

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index c8a2f21f..f932345b 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -47,11 +47,6 @@
 %# END BPS TAGGED BLOCK }}}
 <%INIT>
 
-if ( $m->request_comp->path !~ m{^/RTIR/} ) {
-    Menu()->child( rtir => title => loc('RTIR'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
-    return;
-}
-
 my $query_string = sub {
     my %args = @_;
     my $u    = URI->new();
@@ -75,22 +70,9 @@ my $search_arguments = sub {
     return %res;
 };
 
+my $root = Menu->child( rtir => title => loc('RTIR'), path => '/RTIR/' );
 
-my $orig_menu = Menu();
-
-$HTML::Mason::Commands::m->notes('menu', RT::Interface::Web::Menu->new());
-
-my $rtmenu = Menu->child(rtkids => menu => $orig_menu);
-$rtmenu->title(loc('RT'));
-$rtmenu->path('/');
-$rtmenu->key('rt-menu');
-
-Menu->child(preferences => menu => $orig_menu->child('preferences'));
-$orig_menu->delete('preferences');
-
-my $root = Menu();
-
-my $search = $root->child( search => title => loc('RTIR'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
+my $search = $root->child( search => title => loc('Search'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
 $search->child( new => title => loc('New Search'), path => RT::IR->HREFTo('Search/?NewQuery=1', IncludeWebPath => 0) );
 
 {
diff --git a/html/RTIR/Tools/index.html b/html/RTIR/Tools/index.html
index 3b0f4024..d49861a5 100644
--- a/html/RTIR/Tools/index.html
+++ b/html/RTIR/Tools/index.html
@@ -47,5 +47,5 @@
 %# END BPS TAGGED BLOCK }}}
 <& /RTIR/Elements/Header, Title => loc('RTIR Tools') &>
 <& /Elements/Tabs &>
-<& /Elements/ListMenu, menu => Menu()->child('tools')  &>
+<& /Elements/ListMenu, menu => Menu()->child('rtir')->child('tools')  &>
 

commit 46bc61d47d63a0000062e8dbf69d7ab2d4aa0dd9
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Apr 9 11:18:46 2020 -0400

    Align menu item with queue name for Incident Reports

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index f932345b..75211dd2 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -95,7 +95,7 @@ $root->child(
     path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0),
 );
 $root->child(
-    reports => title => loc('Reports'),
+    reports => title => loc('Incident Reports'),
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0)
 )->child(
     create => title => loc('Create'),

commit 3d84331dee8da381d7f418fa90819439b62bb4fb
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Apr 9 11:47:28 2020 -0400

    Explain menu change in UPGRADING doc

diff --git a/docs/UPGRADING-5.0 b/docs/UPGRADING-5.0
new file mode 100644
index 00000000..e4e5d081
--- /dev/null
+++ b/docs/UPGRADING-5.0
@@ -0,0 +1,22 @@
+=head1 Upgrading to 5.0
+
+The following describes some of the key components of the upgrade
+to RTIR 5.0 from earlier versions. The other UPGRADING documents contain
+details for previous versions.
+
+=head2 Notable Changes
+
+=over
+
+=item *
+
+In RTIR 4.0, we modified the menu display to move each queue to a
+top level menu item when working inside RTIR. Each menu ended up
+having just a "Create" entry and we haven't found new menu items
+to add for each queue. This change made it harder to access the
+default RT menus, so we have reverted to the previous configuration
+with a single RTIR menu item containing relevant links.
+
+=back
+
+=cut

commit b277514db24a424fb1c9504fae830a947f1b5224
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Apr 29 17:05:48 2020 -0400

    Load incident create page without a queue
    
    Allow the incident create page to load even when no queue is
    passed by defaulting to the first queue with an incident lifecycle.
    
    Since 7b96b55e6 moved queue selection to the create page, users
    can select a different queue from the page if needed.

diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 186c9e08..5e587e28 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -130,7 +130,7 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
       <&|/l&>Queue</&>:
     </div>
     <div class="value col-md-9">
-      <& /RTIR/Elements/SelectRTIRQueue, Name => "Queue", Default => $ARGS{Queue}, AutoSubmit => 1, ShowNullOption => 0 &>
+      <& /RTIR/Elements/SelectRTIRQueue, Name => "Queue", Default => $queue, AutoSubmit => 1, ShowNullOption => 0 &>
     </div>
   </div>
   <div class="form-row">
@@ -363,12 +363,27 @@ for my $related_ticket ($ChildObj, $SplitObj) {
         last;
 }
 
+# Load the first Incident queue if none is provided
+my $queue = $ARGS{'Queue'};
+unless ( $queue ) {
+    my $queues = RT::Queues->new( RT->SystemUser );
+
+    $queues->Limit(
+        FIELD => 'Lifecycle',
+        OPERATOR => '=',
+        VALUE => RT::IR->lifecycle_incident,
+    );
+
+    if ( my $first_queue = $queues->First ) {
+        $queue = $first_queue->Id;
+    }
+}
 
 my $QueueObj = RT::Queue->new($session{'CurrentUser'});
-$QueueObj->Load( $ARGS{Queue} );
+$QueueObj->Load( $queue );
 
 if (!$QueueObj->Name) {
-Abort( loc("Queue '[_1]' could not be loaded.", $ARGS{Queue}) );
+Abort( loc("Queue '[_1]' could not be loaded.", $queue) );
  }
 
 if( !RT::IR->IsIncidentQueue($QueueObj) ) {

commit ab4578df83d084494eb3453299d27590db50e802
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Apr 29 17:08:59 2020 -0400

    Link directly to create pages in menus
    
    Queue is now selected on the create page so the queue
    selection modal is no longer needed.

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 75211dd2..2349d71a 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -92,21 +92,21 @@ $root->child(
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0)
 )->child(
     create => title => loc('Create'),
-    path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0),
+    path => RT::IR->HREFTo('Incident/Create.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0),
 );
 $root->child(
     reports => title => loc('Incident Reports'),
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0)
 )->child(
     create => title => loc('Create'),
-    path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0),
+    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_report, IncludeWebPath => 0),
 );
 $root->child(
     investigations => title => loc('Investigations'),
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0)
 )->child(
     launch => title => loc('Launch'),
-    path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0),
+    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0),
 );
 unless ( RT->Config->Get('RTIR_DisableCountermeasures') ) {
     $root->child(
@@ -114,7 +114,7 @@ unless ( RT->Config->Get('RTIR_DisableCountermeasures') ) {
         path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0)
     )->child(
         create => title => loc('Create'),
-        path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0),
+        path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0),
     );
 }
 
@@ -330,8 +330,8 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
     PageMenu()->child(
         new => title => loc("New [_1]", RT::IR::TicketType( Lifecycle => $lifecycle || RT::IR->lifecycle_incident ) ),
         path => !$lifecycle
-            ? RT::IR->HREFTo("CreateInQueue.html?Child=$id&Lifecycle=".RT::IR->lifecycle_incident, IncludeWebPath => 0)
-            : RT::IR->HREFTo("CreateInQueue.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0)
+            ? RT::IR->HREFTo("Incident/Create.html?Child=$id&Lifecycle=".RT::IR->lifecycle_incident, IncludeWebPath => 0)
+            : RT::IR->HREFTo('Create.html' . $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0)
         ,
     );
     PageMenu()->child(
@@ -352,7 +352,7 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
 
     PageMenu()->child(
         new => title => loc("New [_1]",RT::IR::TicketType( Lifecycle => $lifecycle ) ),
-        path => RT::IR->HREFTo("CreateInQueue.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0),
+        path => RT::IR->HREFTo("Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0),
     );
     PageMenu()->child(
         back => title => loc('Back to [_1] #[_2]', lc RT::IR::TicketType( Lifecycle => $ticket->QueueObj->Lifecycle), $id),
@@ -542,5 +542,5 @@ PageWidgets()->child('simple_search')->raw_html( $m->scomp(
     SendTo => RT::IR->HREFTo('index.html', IncludeWebPath => 0),
     Placeholder => 'Search Incidents'
 ) );
-PageWidgets()->child( create_ticket => raw_html => $m->scomp('/RTIR/Elements/CreateTicketInQueue') );
+PageWidgets()->child( create_ticket => raw_html => $HTML::Mason::Commands::m->scomp('/Elements/CreateTicket', SendTo => '/RTIR/Incident/Create.html?Lifecycle='.RT::IR->lifecycle_incident) );
 </%INIT>

commit 83e7b7b7c4cdf5a7b35c06ac99c5d0545c33c9f8
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Apr 30 17:30:02 2020 -0400

    Update tests to find links after menu updates

diff --git a/t/002-test-reject.t b/t/002-test-reject.t
index 7fc0e932..d6d7648b 100644
--- a/t/002-test-reject.t
+++ b/t/002-test-reject.t
@@ -92,7 +92,7 @@ diag "test that after reject links to incidents are still there" if $ENV{'TEST_V
 
     # go to incident and check that we still can see the child
     $agent->display_ticket( $inc_id);
-    $agent->follow_link_ok({text => "Incident Reports"}, "Followed 'Incident Reports' link");
+    $agent->follow_link_ok({text => "Incident Reports", n => 2}, "Followed 'Incident Reports' link");
     $agent->form_number(3);
     $agent->tick( Statuses => 'rejected' );
     $agent->click('RefineStatus');
@@ -122,7 +122,7 @@ diag "test that after quick reject links to incidents are still there" if $ENV{'
 
     # go to incident and check that we still can see the child
     $agent->display_ticket( $inc_id);
-    $agent->follow_link_ok({text => "Incident Reports"}, "Followed 'Incident Reports' link");
+    $agent->follow_link_ok({text => "Incident Reports", n => 2}, "Followed 'Incident Reports' link");
     $agent->form_number(3);
     $agent->tick( Statuses => 'rejected' );
     $agent->click('RefineStatus');
@@ -141,7 +141,7 @@ diag "test that after bulk reject links to incidents are still there" if $ENV{'T
     }
 
     $agent->display_ticket( $id);
-    $agent->follow_link_ok({text => "Reports", url_regex => qr/RTIR/}, "Followed 'Incident Reports' link");
+    $agent->follow_link_ok({text => "Incident Reports", url_regex => qr/RTIR/}, "Followed 'Incident Reports' link");
     while($agent->content() !~ m{Display.html\?id=$id">$id</a>}) {
         last unless $agent->follow_link(text => 'Next');
     }
@@ -161,7 +161,7 @@ diag "test that after bulk reject links to incidents are still there" if $ENV{'T
 
     # go to incident and check that we still can see the child
     $agent->display_ticket( $inc_id);
-    $agent->follow_link_ok({text => "Incident Reports"}, "Followed 'Incident Reports' link");
+    $agent->follow_link_ok({text => "Incident Reports", n => 2}, "Followed 'Incident Reports' link");
     $agent->form_number(3);
     $agent->tick( Statuses => 'rejected' );
     $agent->click('RefineStatus');

commit 9e1322ad5382252c6bde7bcba04e77c546cd60e7
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri May 8 17:03:57 2020 -0400

    Link directly to updated create page rather than modal

diff --git a/html/Callbacks/RTIR/Elements/MakeClicky/Default b/html/Callbacks/RTIR/Elements/MakeClicky/Default
index d6fcaed3..af2560f7 100644
--- a/html/Callbacks/RTIR/Elements/MakeClicky/Default
+++ b/html/Callbacks/RTIR/Elements/MakeClicky/Default
@@ -112,7 +112,7 @@ my %actions;
                       .loc('Lookup IP') .q{</a>};
         if ( $args{incident} && !RT->Config->Get('RTIR_DisableCountermeasures') ) {
             $result .= qq{ <a class="button btn-sm btn-primary create_child_} . RT::IR->lifecycle_countermeasure . qq{" href="} .
-            RT::IR->HREFTo("CreateInQueue.html?Incident=".$args{incident}."&Lifecycle=".RT::IR->lifecycle_countermeasure.qq{&IP-Value=$escaped_host})
+            RT::IR->HREFTo("Create.html?Incident=".$args{incident}."&Lifecycle=".RT::IR->lifecycle_countermeasure.qq{&IP-Value=$escaped_host})
             .qq{">Block</a>};
         }
         if ( $args{'object'} && $args{'object'}->id ) {
@@ -162,7 +162,7 @@ my %actions;
                 $result .= qq{<input type="checkbox" name="Requestorbox-$escaped_email" unchecked />};
             }
             $result .= qq{ <a class="button btn-sm btn-primary" href="}.
-                RT::IR->HREFTo( "CreateInQueue.html"
+                RT::IR->HREFTo( "Create.html"
                 . qq{?Incident=$args{'incident'}}
                 . qq{&Lifecycle=}.RT::IR->lifecycle_investigation
                 . "&Requestors=$escaped_email")
diff --git a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
index 521f4500..5d677871 100644
--- a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
+++ b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
@@ -152,7 +152,7 @@ $COLUMN_MAP->{'LookupToolIncidentActions'} = {
             ;
         }
         push @res, \'<a href="',
-            RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_investigation
+            RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation
             .'&Incident='. $t->id),
             \('" class="create_child_' . RT::IR->lifecycle_investigation . '">'),
             '[' . $t->loc("Investigate") .']',
diff --git a/html/RTIR/Elements/ShowIncidents b/html/RTIR/Elements/ShowIncidents
index a9c58c59..2979f6b7 100644
--- a/html/RTIR/Elements/ShowIncidents
+++ b/html/RTIR/Elements/ShowIncidents
@@ -59,7 +59,7 @@
 <div class="actions">
 % unless ( $action ) {
 <a class="button btn-sm btn btn-primary" id="link-incident" href="<% RT::IR->HREFTo('Link/ToIncident/?id='. $id ) %>">Link</a>
-<a class="button btn-sm btn btn-primary" id="create-incident" href="<% RT::IR->HREFTo('CreateInQueue.html?Lifecycle=' . RT::IR->lifecycle_incident . '&Child='. $id ) %>">New</a>
+<a class="button btn-sm btn btn-primary" id="create-incident" href="<% RT::IR->HREFTo('Incident/Create.html?Lifecycle=' . RT::IR->lifecycle_incident . '&Child='. $id ) %>">New</a>
 % } elsif ( $action ne 'No' ) {
 <a class="button btn-sm btn btn-primary" href="<% RT::IR->HREFTo('Display.html?Action='. $action.'&id='. $id) %>"><% loc( $action ) %></a>
 % }
diff --git a/html/RTIR/Incident/Elements/ShowChildren b/html/RTIR/Incident/Elements/ShowChildren
index 31584955..64c09765 100644
--- a/html/RTIR/Incident/Elements/ShowChildren
+++ b/html/RTIR/Incident/Elements/ShowChildren
@@ -116,7 +116,7 @@ if ( $IncidentObj->CurrentUserHasRight('ModifyTicket') ) {
         push @box_actions, {
             title => $Lifecycle ne RT::IR->lifecycle_investigation? loc('Create') : loc('Launch'),
             class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
-            path => RT::IR->HREFTo("CreateInQueue.html?Incident=$id&Lifecycle=".$Lifecycle),
+            path => RT::IR->HREFTo("Create.html?Incident=$id&Lifecycle=".$Lifecycle),
         };
     }
     push @box_actions, {
diff --git a/html/RTIR/Tools/Elements/LookupSummary b/html/RTIR/Tools/Elements/LookupSummary
index c7495da9..91b936af 100644
--- a/html/RTIR/Tools/Elements/LookupSummary
+++ b/html/RTIR/Tools/Elements/LookupSummary
@@ -109,7 +109,7 @@ if ( $TicketObj && RT::IR->IsIncidentQueue($TicketObj->QueueObj)
         push @box_actions, {
             title => loc('Launch'),
             class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
-            path => RT::IR->HREFTo("CreateInQueue.html?". $m->comp('/Elements/QueryString',
+            path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
                 Incident => $TicketObj->id,
                 Lifecycle => $Lifecycle,
                 Requestors => $q,
@@ -119,7 +119,7 @@ if ( $TicketObj && RT::IR->IsIncidentQueue($TicketObj->QueueObj)
         push @box_actions, {
             title => loc('Create'),
             class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
-            path => RT::IR->HREFTo("CreateInQueue.html?". $m->comp('/Elements/QueryString',
+            path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
                 Incident => $TicketObj->id,
                 Lifecycle => $Lifecycle,
                 'IP-Value' => $q,
@@ -133,7 +133,7 @@ elsif ( $TicketObj && !RT::IR->IsIncidentQueue($TicketObj->QueueObj)
     push @box_actions, {
         title => loc('Create'),
         class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
-        path => RT::IR->HREFTo("CreateInQueue.html?". $m->comp('/Elements/QueryString',
+        path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
             Child => $TicketObj->id,
             Lifecycle => $Lifecycle
         )),

commit b9b3a8ed6b4b17a9e9f061ba61d932c56d81f714
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Wed May 13 18:54:04 2020 -0500

    Remove CreateInQueue modal element and JS
    
    RTIR is linking directly to the Create.html pages and no longer
    using the modal.

diff --git a/html/RTIR/Helpers/CreateInRTIRQueueModal b/html/RTIR/Helpers/CreateInRTIRQueueModal
deleted file mode 100644
index e8d38960..00000000
--- a/html/RTIR/Helpers/CreateInRTIRQueueModal
+++ /dev/null
@@ -1,49 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2018 Best Practical Solutions, LLC
-%#                                          <sales at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<& /RTIR/Elements/CreateInRTIRQueueModal, %ARGS &>
-% $m->abort;
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 7459e6e8..415dbb4e 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -135,7 +135,6 @@ use Parse::BooleanLogic;
 my $ticket_sql_parser = Parse::BooleanLogic->new;
 
 RT->AddJavaScript('jquery.uncheckable-radio-0.1.js');
-RT->AddJavaScript('rtir.js');
 RT->AddStyleSheets( 'rtir-styles.css' );
 
 # Add the RTIR search result page to the whitelist to allow
diff --git a/static/js/rtir.js b/static/js/rtir.js
deleted file mode 100644
index 92616cb0..00000000
--- a/static/js/rtir.js
+++ /dev/null
@@ -1,75 +0,0 @@
-jQuery(function() {
-    var getQueryString = function(element) {
-        var href = jQuery(element).attr('href');
-        if (!href) return '';
-        var questionMarkIndex = href.indexOf('?');
-        if (!questionMarkIndex) return '';
-        return href.substring(questionMarkIndex+1);
-    };
-
-    var showModal = function(lifecycle, triggeringObject) {
-        var queryString = getQueryString(triggeringObject);
-        var constituency = '';
-
-        var uri = window.location.href.split('/');
-        for (var i = 0; i < uri.length; i++) {
-            if (uri[i] === 'c') {
-                constituency = '/c/' + uri[i+1];
-                break;
-            }
-        }
-
-        jQuery.get(
-            RT.Config.WebHomePath + '/RTIR' + constituency + '/Helpers/CreateInRTIRQueueModal?Lifecycle=' + lifecycle + '&' + queryString,
-            function(html) {
-                // If there's only one queue, just create a ticket in it and skip the modal
-                var queues = jQuery(html).find("select[name='Queue'] > option");
-                if (queues.length === 1) {
-                    window.location.href = RT.Config .WebHomePath + '/RTIR/Create.html?Queue=' + queues.first().val() + '&' + queryString;
-                    return;
-                }
-
-                var modal = jQuery("<div class='modal'></div>");
-                modal.append(html).appendTo("body");
-                modal.bind('modal:close', function(ev) { modal.remove(); })
-                modal.on('hide.bs.modal', function(ev) { modal.remove(); })
-                modal.modal('show');
-
-                // We need to refresh the select picker plugin on AJAX calls
-                // since the plugin only runs on page load.
-                jQuery('.selectpicker').selectpicker('refresh');
-            }
-        );
-    };
-
-    var showReportsModal = function(e) {
-        e.preventDefault();
-        showModal('incident_reports', this);
-    };
-
-    var showInvestigationsModal = function(e) {
-        e.preventDefault();
-        showModal('investigations', this);
-    };
-
-    var showCountermeasuresModal = function(e) {
-        e.preventDefault();
-        showModal('countermeasures', this);
-    };
-
-    var showIncidentsModal = function(e) {
-        e.preventDefault();
-        showModal('incidents', this);
-    };
-
-    jQuery('body').on('click', '#reports-create', showReportsModal);
-    jQuery('body').on('click', '#investigations-launch', showInvestigationsModal);
-    jQuery('body').on('click', '#countermeasures-create', showCountermeasuresModal);
-    jQuery('body').on('click', '#incidents-create', showIncidentsModal);
-    jQuery('body').on('click', '#create-incident', showIncidentsModal);
-
-    jQuery('body').on('click', '.create_child_incidents', showIncidentsModal);
-    jQuery('body').on('click', '.create_child_incident_reports', showReportsModal);
-    jQuery('body').on('click', '.create_child_investigations', showInvestigationsModal);
-    jQuery('body').on('click', '.create_child_countermeasures', showCountermeasuresModal);
-});

commit 5e3ac6aa54ab4d4cd401c374d33b8ecc519d84c4
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Wed May 13 18:58:03 2020 -0500

    Add deprecated warning to CreateInQueue.html
    
    For users linking directly to CreateInQueue.html a deprecated
    warning and entry to UPGRADING-5.0 has been added with instructions
    to switch to the Create.html pages.

diff --git a/docs/UPGRADING-5.0 b/docs/UPGRADING-5.0
index e4e5d081..90c9991c 100644
--- a/docs/UPGRADING-5.0
+++ b/docs/UPGRADING-5.0
@@ -17,6 +17,18 @@ to add for each queue. This change made it harder to access the
 default RT menus, so we have reverted to the previous configuration
 with a single RTIR menu item containing relevant links.
 
+=item *
+
+To align with RT's create pages we removed the modal to select queue
+before the create page and now give users the option to select
+queue directly on create. CreateInQueue.html still remains available
+incase users are linking directly to it but now logs a deprecated
+warning when accessed.
+
+CreateInQueue.html will be removed in a future version of RTIR.
+Please update any links directly accessing CreateInQueue.html to
+instead link to RTIR/Create.html or RTIR/Incident/Create.html.
+
 =back
 
 =cut
diff --git a/html/RTIR/CreateInQueue.html b/html/RTIR/CreateInQueue.html
index 77571253..25d9e229 100644
--- a/html/RTIR/CreateInQueue.html
+++ b/html/RTIR/CreateInQueue.html
@@ -53,6 +53,7 @@
 <& /RTIR/Elements/CreateInRTIRQueue, %ARGS &>
 
 <%INIT>
+RT->Deprecated( Instead => 'Create.html' );
 $ARGS{ticket_type} = RT::IR::TicketType( Lifecycle => $Lifecycle );
 my $title = "Select Queue for New $ARGS{ticket_type}";
 </%INIT>

commit 05573899b094509d82d16d6b52c23cadc52665fd
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Wed May 13 19:08:17 2020 -0500

    Fix default queue on create pages
    
    If the Queue arg is not defined, RT's GetDefaultQueue sub returns
    a queue not correctly scoped to the current user which leads to an
    Abort for unable to load queue.
    
    This commit modifies the Create.html pages to get a default queue
    limited to the Lifecycle arg or RTIR Lifecycles for the current
    user.

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 02d6fd00..b832d2be 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -108,6 +108,7 @@
             args => {
                 Name           => 'Queue',
                 Default        => $Queue,
+                Lifecycle      => $Lifecycle,
                 ShowNullOption => 0,
                 AutoSubmit     => 1,
             },
@@ -381,25 +382,40 @@
 # Make sure even a single checkbox value becomes an arrayref
 $ARGS{'SkipNotification'} = \@SkipNotification;
 
-# XXX TODO remove this code that maps lifecycles to queues
-if ($Lifecycle && ! $Queue) {
-    $Queue=ucfirst($Lifecycle);
-    $Queue=~ s/_r/ R/;
-    $ARGS{'Queue'} = $Queue;
-}
-
 my $constituency = $m->{'RTIR_ConstituencyFilter'};
 
-
 my %CFDefaults;
 $m->callback(
     CallbackName => 'Init', CallbackPage => '/Ticket/Create.html',
     ARGSRef => \%ARGS,
 );
 
-# Use default queue from config site or user prefs if none provided
+# If the Queue is not passed in as an ARG, go get and set queue from the queues the user can CreateTicket.
+# For constituency users without access to the default RTIR queues we need to specifically check and limit
+# else we Abort below when we attempt to load the default queue as the user.
 unless ($Queue) {
-    $Queue = GetDefaultQueue();
+    my $collection = RT::Queues->new($session{'CurrentUser'});
+
+    # RT::Queues::AddRecord verifies the user has 'SeeQueue', so we don't
+    # need to specifically test for that in the while loop below.
+    if ($Lifecycle) {
+        $collection->Limit(FIELD => 'Lifecycle', OPERATOR => '=', VALUE => $Lifecycle);
+    }
+    else {
+        $collection->Limit(
+            FIELD => 'Lifecycle',
+            OPERATOR => 'IN',
+            VALUE => [RT::IR->Lifecycles],
+        );
+    }
+
+    while (my $object = $collection->Next) {
+        # Ensure the user can CreateTicket in the queue.
+        next unless $session{CurrentUser}->HasRight( Object => $object, Right => 'CreateTicket' );
+
+        $Queue = $object->Id;
+        last;
+    }
 }
 
 # pick first in list in normal order unless queue provided from form/url/defaults
@@ -413,8 +429,6 @@ unless ($Queue) {
     $Queue = $session{$cache_key}{objects}[0]->{Id};
 }
 
-$session{DefaultQueue} = $Queue;
-
 my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
 $QueueObj->Load( $Queue );
 
@@ -422,9 +436,7 @@ if (!$QueueObj->Name) {
  Abort( loc("Queue '[_1]' could not be loaded.",$Queue) );
  }
 
-if ($Queue && !$Lifecycle) {
-    $Lifecycle = $QueueObj->Lifecycle;
-}
+$Lifecycle ||= $QueueObj->Lifecycle;
 
 my $ticket = RT::Ticket->new($session{'CurrentUser'}); # empty ticket object
 
@@ -565,14 +577,14 @@ unshift @results, loc("Creation failed:")
 
 my ($Title, $SubmitCaption);
 if ( $Split ) {
-$Title = loc("Split [_1] #[_2]: [_3]", RT::IR::TicketType(Lifecycle => $QueueObj->Lifecycle), $SplitObj->id, $SplitObj->Subject);
+$Title = loc("Split [_1] #[_2]: [_3]", RT::IR::TicketType(Lifecycle => $Lifecycle), $SplitObj->id, $SplitObj->Subject);
     $SubmitCaption = loc("Split");
 } else {
 if ( RT::IR->IsInvestigationQueue($QueueObj) ) {
     $Title = loc("Launch a new investigation");
         $SubmitCaption = loc("Launch");
     } else {
-    $Title = loc("Create a new [_1]", RT::IR::TicketType(Lifecycle => $QueueObj->Lifecycle));
+    $Title = loc("Create a new [_1]", RT::IR::TicketType(Lifecycle => $Lifecycle));
         $SubmitCaption = loc("Create");
     }
 }
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 5e587e28..53b91ca9 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -130,7 +130,7 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
       <&|/l&>Queue</&>:
     </div>
     <div class="value col-md-9">
-      <& /RTIR/Elements/SelectRTIRQueue, Name => "Queue", Default => $queue, AutoSubmit => 1, ShowNullOption => 0 &>
+      <& /RTIR/Elements/SelectRTIRQueue, Name => "Queue", Default => $queue, Lifecycle => $QueueObj->Lifecycle, AutoSubmit => 1, ShowNullOption => 0 &>
     </div>
   </div>
   <div class="form-row">
@@ -366,7 +366,7 @@ for my $related_ticket ($ChildObj, $SplitObj) {
 # Load the first Incident queue if none is provided
 my $queue = $ARGS{'Queue'};
 unless ( $queue ) {
-    my $queues = RT::Queues->new( RT->SystemUser );
+    my $queues = RT::Queues->new($session{'CurrentUser'});
 
     $queues->Limit(
         FIELD => 'Lifecycle',
@@ -374,8 +374,12 @@ unless ( $queue ) {
         VALUE => RT::IR->lifecycle_incident,
     );
 
-    if ( my $first_queue = $queues->First ) {
-        $queue = $first_queue->Id;
+    while (my $object = $queues->Next) {
+        # Ensure the user can CreateTicket in the queue.
+        next unless $session{CurrentUser}->HasRight( Object => $object, Right => 'CreateTicket' );
+
+        $queue = $object->Id;
+        last;
     }
 }
 

commit 80fc158e823c5359eaf780e074eece8eab68acff
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Fri May 15 13:46:42 2020 -0500

    Fix available statuses on create pages
    
    Statuses were not correct for the lifecycle the ticket was being
    create in.
    
    Get the statuses specific to the lifecycle to pass to SelectStatus.

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index b832d2be..86585ab4 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -120,6 +120,7 @@
                 Name         => "Status",
                 Default      => $ARGS{Status} || $QueueObj->LifecycleObj->DefaultOnCreate,
                 DefaultValue => 0,
+                Statuses     => [ RT::IR->Statuses( Lifecycle => $Lifecycle ) ],
                 SkipDeleted  => 1,
                 Object       => $QueueObj,
             },
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 53b91ca9..d226e929 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -143,6 +143,7 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
           Object => $QueueObj,
           DefaultValue => 0,
           Default => $ARGS{Status} || $QueueObj->LifecycleObj->DefaultOnCreate,
+          Statuses => [ RT::IR->Statuses( Lifecycle => RT::IR->lifecycle_incident ) ],
       &>
     </div>
   </div>

commit b9c0370016ec56ecfad579f50b9f40cb7b6e22ab
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Wed May 13 19:33:23 2020 -0500

    Update test library to create tickets directly
    
    This commit updates the test library to create tickets through
    the Create.html pages instead of the deprecated CreateInQueue.html.

diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
index 36c9e7fc..21e588f4 100644
--- a/lib/RT/IR/Test/Web.pm
+++ b/lib/RT/IR/Test/Web.pm
@@ -86,8 +86,7 @@ sub goto_create_rtir_ticket {
         warn "Failed to load queue: $queue";
     }
 
-    $self->get_ok("/RTIR/CreateInQueue.html?Lifecycle=$lifecycle");
-    $self->click_through_createinqueue( $queue );
+    $self->get_ok("/RTIR/" . ($lifecycle eq 'incidents' ? 'Incident/' : '') . "Create.html?Lifecycle=$lifecycle&Queue=" . $queue_obj->id);
 
     # set the form
     return $self->form_number(3);
@@ -149,7 +148,6 @@ sub create_incident_for_ir {
     # Select the "New" link from the Display page
     $self->follow_link_ok({id => 'create-incident'}, "Followed 'New (Incident)' link")
         or Test::More::diag $self->content;
-    $self->click_through_createinqueue;
 
     $self->form_number(3);
 
@@ -395,19 +393,4 @@ sub bulk_abandon {
     return;
 }
 
-
-sub click_through_createinqueue
-{
-    my $self = shift;
-    my $queue = shift || undef;
-
-    my %args;
-    $args{fields} = { Queue => $queue } if $queue;
-
-    $self->submit_form(
-        form_id => 'CreateInQueue',
-        %args,
-    );
-}
-
 1;
diff --git a/t/020-incident-and-investigation.t b/t/020-incident-and-investigation.t
index 1e04b5d6..eabd3bf7 100755
--- a/t/020-incident-and-investigation.t
+++ b/t/020-incident-and-investigation.t
@@ -72,7 +72,6 @@ my $incident_bar = $agent->create_incident(
 $agent->display_ticket($incident_foo);
 
 $agent->follow_link_ok({text => 'Launch', n => 2}, "Followed 'Launch' link");
-$agent->click_through_createinqueue;
 $agent->form_name('TicketCreate');
 is($agent->value('Incident'), $incident_foo, 'Incident foo is checked');
 $agent->field('Incident', $incident_bar);
diff --git a/t/custom-fields/defaults-on-linking.t b/t/custom-fields/defaults-on-linking.t
index 37d12c32..5392643d 100644
--- a/t/custom-fields/defaults-on-linking.t
+++ b/t/custom-fields/defaults-on-linking.t
@@ -55,7 +55,6 @@ my $agent = default_agent();
         $agent->display_ticket( $ir_id );
         $agent->follow_link_ok({text => "New"}, "Followed 'New (Incident)' link")
             or diag $agent->content;
-        $agent->click_through_createinqueue;
         $agent->form_number(3);
 
         my $input = $agent->custom_field_input( 'Incidents', $cf_name );
diff --git a/t/incident/split.t b/t/incident/split.t
index 8e8e313f..bd1b6a53 100644
--- a/t/incident/split.t
+++ b/t/incident/split.t
@@ -26,7 +26,6 @@ my $rtir_user = rtir_user();
     ok ($new_id, "Ticket created successfully: #$new_id.");
 
     $agent->follow_link_ok({text => "Launch", n => 2 }, "Followed link");
-    $agent->click_through_createinqueue;
     $agent->form_number(3);
     $agent->field('Requestors', $rtir_user->EmailAddress);
     $agent->click('Create');

commit d3f311e9f05271eeba3926a432b4888093ae0cb4
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Wed May 13 19:45:01 2020 -0500

    Update test for modal removal
    
    The functionality tested in modal.t is still valueable, although
    not correctly named since removing the create in queue modal. This
    commit renames the test as well as updates the tests to verify the
    queue select options on the Create pages instead.
    
    Additionally, the regexs within the tests were slightly loosened to
    more easily allow for pre-selected options in the dropdown.

diff --git a/t/constituency/modal.t b/t/constituency/modal.t
deleted file mode 100644
index 43852f05..00000000
--- a/t/constituency/modal.t
+++ /dev/null
@@ -1,164 +0,0 @@
-use strict;
-use warnings;
-
-use RT::IR::Test tests => undef;
-
-use_ok('RT::IR');
-
-my ($baseurl) = RT::Test->started_ok;
-my $m = default_agent();
-my $rtir_user = RT::CurrentUser->new( rtir_user() );
-my ($ok, $msg);
-
-diag "create constituencies EDUNET and GOVNET" if $ENV{'TEST_VERBOSE'};
-{
-    for my $constituency_name ( qw(EDUNET GOVNET) ) {
-        my $manager = RT::IR::ConstituencyManager->new(Constituency => $constituency_name);
-        ok($manager->AddConstituency, "added constituency $constituency_name");
-    }
-}
-
-my $eduhandler = RT::Test->load_or_create_user( Name => 'eduhandler', Password => 'eduhandler' );
-ok $eduhandler->id, "Created eduhandler";
-
-my $govhandler = RT::Test->load_or_create_user( Name => 'govhandler', Password => 'govhandler' );
-ok $govhandler->id, "Created govhandler";
-
-my $edugroup = RT::Group->new( RT->SystemUser );
-$edugroup->LoadUserDefinedGroup('DutyTeam EDUNET');
-$edugroup->AddMember( $eduhandler->PrincipalId );
-$edugroup->AddMember( $rtir_user->PrincipalId );
-
-my $govgroup = RT::Group->new( RT->SystemUser );
-$govgroup->LoadUserDefinedGroup('DutyTeam GOVNET');
-$govgroup->AddMember( $govhandler->PrincipalId );
-$govgroup->AddMember( $rtir_user->PrincipalId );
-
-diag "check queue visibility in modal" if $ENV{'TEST_VERBOSE'};
-{
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incident_reports");
-    $m->content_like(qr{<option value="\d+">Incident Reports</option>}, 'Queue dropdown has standard incident reports queue');
-    $m->content_like(qr{<option value="\d+">Incident Reports - EDUNET</option>}, 'Queue dropdown has EDUNET incident reports queue');
-    $m->content_like(qr{<option value="\d+">Incident Reports - GOVNET</option>}, 'Queue dropdown has GOVNET incident reports queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents");
-    $m->content_like(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown has standard incidents queue');
-    $m->content_like(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown has EDUNET incidents queue');
-    $m->content_like(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=investigations");
-    $m->content_like(qr{<option value="\d+">Investigations</option>}, 'Queue dropdown has standard investigations queue');
-    $m->content_like(qr{<option value="\d+">Investigations - EDUNET</option>}, 'Queue dropdown has EDUNET investigations queue');
-    $m->content_like(qr{<option value="\d+">Investigations - GOVNET</option>}, 'Queue dropdown has GOVNET investigations queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=countermeasures");
-    $m->content_like(qr{<option value="\d+">Countermeasures</option>}, 'Queue dropdown has standard countermeasures queue');
-    $m->content_like(qr{<option value="\d+">Countermeasures - EDUNET</option>}, 'Queue dropdown has EDUNET countermeasures queue');
-    $m->content_like(qr{<option value="\d+">Countermeasures - GOVNET</option>}, 'Queue dropdown has GOVNET countermeasures queue');
-}
-
-diag "check queue visibility in modal when created from incident" if $ENV{'TEST_VERBOSE'};
-{
-    my $i = RT::Ticket->new( $rtir_user );
-    ($ok, $msg) = $i->Create(
-        Subject => 'test incident',
-        Queue => 'Incidents - GOVNET',
-    );
-    ok($ok, 'created test incident');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incident_reports&Incident=".$i->id);
-    $m->content_like(qr{<option value="\d+">Incident Reports - GOVNET</option>}, 'Queue dropdown has GOVNET incident reports queue');
-    $m->content_unlike(qr{<option value="\d+">Incident Reports</option>}, 'Queue dropdown doesn\'t have standard incident reports queue');
-    $m->content_unlike(qr{<option value="\d+">Incident Reports - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incident reports queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=investigations&Incident=".$i->id);
-    $m->content_like(qr{<option value="\d+">Investigations - GOVNET</option>}, 'Queue dropdown has GOVNET investigations queue');
-    $m->content_unlike(qr{<option value="\d+">Investigations</option>}, 'Queue dropdown doesn\'t have standard investigations queue');
-    $m->content_unlike(qr{<option value="\d+">Investigations - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET investigations queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=countermeasures&Incident=".$i->id);
-    $m->content_like(qr{<option value="\d+">Countermeasures - GOVNET</option>}, 'Queue dropdown has GOVNET countermeasures queue');
-    $m->content_unlike(qr{<option value="\d+">Countermeasures</option>}, 'Queue dropdown doesn\'t have standard countermeasures queue');
-    $m->content_unlike(qr{<option value="\d+">Countermeasures - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET countermeasures queue');
-}
-
-diag "check queue visibility in modal when created from incident report" if $ENV{'TEST_VERBOSE'};
-{
-    my $r = RT::Ticket->new( $rtir_user );
-    ($ok, $msg) = $r->Create(
-        Subject => 'test incident report',
-        Queue => 'Incident Reports - GOVNET',
-    );
-    ok($ok, 'created test incident report');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents&Child=".$r->id);
-    $m->content_like(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
-    $m->content_unlike(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
-    $m->content_unlike(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incidents queue');
-}
-
-diag "check queue visibility in modal when filtering constituency" if $ENV{'TEST_VERBOSE'};
-{
-    $m->get("$baseurl/RTIR/c/GOVNET/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents");
-    $m->content_like(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
-    $m->content_unlike(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incidents queue');
-    $m->content_unlike(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
-
-    $m->get("$baseurl/RTIR/c/EDUNET/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents");
-    $m->content_like(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown has EDUNET incidents queue');
-    $m->content_unlike(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
-    $m->content_unlike(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET incidents queue');
-}
-
-diag "check queue visibility in modal - eduhandler" if $ENV{'TEST_VERBOSE'};
-{
-    $m->login('eduhandler', 'eduhandler', logout => 1);
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incident_reports");
-    $m->content_like(qr{<option value="\d+">Incident Reports - EDUNET</option>}, 'Queue dropdown has EDUNET incident reports queue');
-    $m->content_unlike(qr{<option value="\d+">Incident Reports</option>}, 'Queue dropdown doesn\'t have standard incident reports queue');
-    $m->content_unlike(qr{<option value="\d+">Incident Reports - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET incident reports queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents");
-    $m->content_like(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown has EDUNET incidents queue');
-    $m->content_unlike(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
-    $m->content_unlike(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET incidents queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=investigations");
-    $m->content_like(qr{<option value="\d+">Investigations - EDUNET</option>}, 'Queue dropdown has EDUNET investigations queue');
-    $m->content_unlike(qr{<option value="\d+">Investigations</option>}, 'Queue dropdown doesn\'t have standard investigations queue');
-    $m->content_unlike(qr{<option value="\d+">Investigations - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET investigations queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=countermeasures");
-    $m->content_like(qr{<option value="\d+">Countermeasures - EDUNET</option>}, 'Queue dropdown has EDUNET countermeasures queue');
-    $m->content_unlike(qr{<option value="\d+">Countermeasures</option>}, 'Queue dropdown doesn\'t have standard countermeasures queue');
-    $m->content_unlike(qr{<option value="\d+">Countermeasures - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET countermeasures queue');
-}
-
-diag "check queue visibility in modal - govhandler" if $ENV{'TEST_VERBOSE'};
-{
-    $m->login('govhandler', 'govhandler', logout => 1);
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incident_reports");
-    $m->content_like(qr{<option value="\d+">Incident Reports - GOVNET</option>}, 'Queue dropdown has GOVNET incident reports queue');
-    $m->content_unlike(qr{<option value="\d+">Incident Reports - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incident reports queue');
-    $m->content_unlike(qr{<option value="\d+">Incident Reports</option>}, 'Queue dropdown doesn\'t have standard incident reports queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents");
-    $m->content_like(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
-    $m->content_unlike(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incidents queue');
-    $m->content_unlike(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=investigations");
-    $m->content_like(qr{<option value="\d+">Investigations - GOVNET</option>}, 'Queue dropdown has GOVNET investigations queue');
-    $m->content_unlike(qr{<option value="\d+">Investigations - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET investigations queue');
-    $m->content_unlike(qr{<option value="\d+">Investigations</option>}, 'Queue dropdown doesn\'t have standard investigations queue');
-
-    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=countermeasures");
-    $m->content_like(qr{<option value="\d+">Countermeasures - GOVNET</option>}, 'Queue dropdown has GOVNET countermeasures queue');
-    $m->content_unlike(qr{<option value="\d+">Countermeasures - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET countermeasures queue');
-    $m->content_unlike(qr{<option value="\d+">Countermeasures</option>}, 'Queue dropdown doesn\'t have standard countermeasures queue');
-}
-
-undef $m;
-done_testing;
diff --git a/t/constituency/queue_select.t b/t/constituency/queue_select.t
new file mode 100644
index 00000000..e5ed5f12
--- /dev/null
+++ b/t/constituency/queue_select.t
@@ -0,0 +1,153 @@
+use strict;
+use warnings;
+
+use RT::IR::Test tests => undef;
+
+use_ok('RT::IR');
+
+my ($baseurl) = RT::Test->started_ok;
+my $m = default_agent();
+my $rtir_user = RT::CurrentUser->new( rtir_user() );
+my ($ok, $msg);
+
+diag "create constituencies EDUNET and GOVNET" if $ENV{'TEST_VERBOSE'};
+{
+    for my $constituency_name ( qw(EDUNET GOVNET) ) {
+        my $manager = RT::IR::ConstituencyManager->new(Constituency => $constituency_name);
+        ok($manager->AddConstituency, "added constituency $constituency_name");
+    }
+}
+
+my $eduhandler = RT::Test->load_or_create_user( Name => 'eduhandler', Password => 'eduhandler' );
+ok $eduhandler->id, "Created eduhandler";
+
+my $govhandler = RT::Test->load_or_create_user( Name => 'govhandler', Password => 'govhandler' );
+ok $govhandler->id, "Created govhandler";
+
+my $edugroup = RT::Group->new( RT->SystemUser );
+$edugroup->LoadUserDefinedGroup('DutyTeam EDUNET');
+$edugroup->AddMember( $eduhandler->PrincipalId );
+$edugroup->AddMember( $rtir_user->PrincipalId );
+
+my $govgroup = RT::Group->new( RT->SystemUser );
+$govgroup->LoadUserDefinedGroup('DutyTeam GOVNET');
+$govgroup->AddMember( $govhandler->PrincipalId );
+$govgroup->AddMember( $rtir_user->PrincipalId );
+
+diag "check queue visibility" if $ENV{'TEST_VERBOSE'};
+{
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=incident_reports");
+    $m->content_like(qr{Incident Reports</option>}, 'Queue dropdown has standard incident reports queue');
+    $m->content_like(qr{Incident Reports - EDUNET</option>}, 'Queue dropdown has EDUNET incident reports queue');
+    $m->content_like(qr{Incident Reports - GOVNET</option>}, 'Queue dropdown has GOVNET incident reports queue');
+
+    $m->get("$baseurl/RTIR/Incident/Create.html?Lifecycle=incidents");
+    $m->content_like(qr{Incidents</option>}, 'Queue dropdown has standard incidents queue');
+    $m->content_like(qr{Incidents - EDUNET</option>}, 'Queue dropdown has EDUNET incidents queue');
+    $m->content_like(qr{Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=investigations");
+    $m->content_like(qr{Investigations</option>}, 'Queue dropdown has standard investigations queue');
+    $m->content_like(qr{Investigations - EDUNET</option>}, 'Queue dropdown has EDUNET investigations queue');
+    $m->content_like(qr{Investigations - GOVNET</option>}, 'Queue dropdown has GOVNET investigations queue');
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=countermeasures");
+    $m->content_like(qr{Countermeasures</option>}, 'Queue dropdown has standard countermeasures queue');
+    $m->content_like(qr{Countermeasures - EDUNET</option>}, 'Queue dropdown has EDUNET countermeasures queue');
+    $m->content_like(qr{Countermeasures - GOVNET</option>}, 'Queue dropdown has GOVNET countermeasures queue');
+}
+
+diag "check queue visibility when created from incident" if $ENV{'TEST_VERBOSE'};
+{
+    my $id = $m->create_rtir_ticket_ok( 'Incidents - GOVNET', { Subject => 'test incident' } );
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=incident_reports&Incident=$id");
+    $m->content_like(qr{Incident Reports - GOVNET</option>}, 'Queue dropdown has GOVNET incident reports queue');
+    $m->content_unlike(qr{Incident Reports</option>}, 'Queue dropdown doesn\'t have standard incident reports queue');
+    $m->content_unlike(qr{Incident Reports - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incident reports queue');
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=investigations&Incident=$id");
+    $m->content_like(qr{Investigations - GOVNET</option>}, 'Queue dropdown has GOVNET investigations queue');
+    $m->content_unlike(qr{Investigations</option>}, 'Queue dropdown doesn\'t have standard investigations queue');
+    $m->content_unlike(qr{Investigations - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET investigations queue');
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=countermeasures&Incident=$id");
+    $m->content_like(qr{Countermeasures - GOVNET</option>}, 'Queue dropdown has GOVNET countermeasures queue');
+    $m->content_unlike(qr{Countermeasures</option>}, 'Queue dropdown doesn\'t have standard countermeasures queue');
+    $m->content_unlike(qr{Countermeasures - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET countermeasures queue');
+}
+
+diag "check queue visibility when created from incident report" if $ENV{'TEST_VERBOSE'};
+{
+    my $id = $m->create_rtir_ticket_ok( 'Incident Reports - GOVNET', { Subject => 'test incident report' } );
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=incidents&Child=$id");
+    $m->content_like(qr{Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
+    $m->content_unlike(qr{Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
+    $m->content_unlike(qr{Incidents - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incidents queue');
+}
+
+diag "check queue visibility when filtering constituency" if $ENV{'TEST_VERBOSE'};
+{
+    $m->get("$baseurl/RTIR/c/GOVNET/Create.html?Lifecycle=incidents");
+    $m->content_like(qr{Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
+    $m->content_unlike(qr{Incidents - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incidents queue');
+    $m->content_unlike(qr{Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
+
+    $m->get("$baseurl/RTIR/c/EDUNET/Create.html?Lifecycle=incidents");
+    $m->content_like(qr{Incidents - EDUNET</option>}, 'Queue dropdown has EDUNET incidents queue');
+    $m->content_unlike(qr{Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
+    $m->content_unlike(qr{Incidents - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET incidents queue');
+}
+
+diag "check queue visibility - eduhandler" if $ENV{'TEST_VERBOSE'};
+{
+    $m->login('eduhandler', 'eduhandler', logout => 1);
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=incident_reports");
+    $m->content_like(qr{Incident Reports - EDUNET</option>}, 'Queue dropdown has EDUNET incident reports queue');
+    $m->content_unlike(qr{Incident Reports</option>}, 'Queue dropdown doesn\'t have standard incident reports queue');
+    $m->content_unlike(qr{Incident Reports - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET incident reports queue');
+
+    $m->get("$baseurl/RTIR/Incident/Create.html?Lifecycle=incidents");
+    $m->content_like(qr{Incidents - EDUNET</option>}, 'Queue dropdown has EDUNET incidents queue');
+    $m->content_unlike(qr{Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
+    $m->content_unlike(qr{Incidents - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET incidents queue');
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=investigations");
+    $m->content_like(qr{Investigations - EDUNET</option>}, 'Queue dropdown has EDUNET investigations queue');
+    $m->content_unlike(qr{Investigations</option>}, 'Queue dropdown doesn\'t have standard investigations queue');
+    $m->content_unlike(qr{Investigations - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET investigations queue');
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=countermeasures");
+    $m->content_like(qr{Countermeasures - EDUNET</option>}, 'Queue dropdown has EDUNET countermeasures queue');
+    $m->content_unlike(qr{Countermeasures</option>}, 'Queue dropdown doesn\'t have standard countermeasures queue');
+    $m->content_unlike(qr{Countermeasures - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET countermeasures queue');
+}
+
+diag "check queue visibility - govhandler" if $ENV{'TEST_VERBOSE'};
+{
+    $m->login('govhandler', 'govhandler', logout => 1);
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=incident_reports");
+    $m->content_like(qr{Incident Reports - GOVNET</option>}, 'Queue dropdown has GOVNET incident reports queue');
+    $m->content_unlike(qr{Incident Reports - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incident reports queue');
+    $m->content_unlike(qr{Incident Reports</option>}, 'Queue dropdown doesn\'t have standard incident reports queue');
+
+    $m->get("$baseurl/RTIR/Incident/Create.html?Lifecycle=incidents");
+    $m->content_like(qr{Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
+    $m->content_unlike(qr{Incidents - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incidents queue');
+    $m->content_unlike(qr{Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=investigations");
+    $m->content_like(qr{Investigations - GOVNET</option>}, 'Queue dropdown has GOVNET investigations queue');
+    $m->content_unlike(qr{Investigations - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET investigations queue');
+    $m->content_unlike(qr{Investigations</option>}, 'Queue dropdown doesn\'t have standard investigations queue');
+
+    $m->get("$baseurl/RTIR/Create.html?Lifecycle=countermeasures");
+    $m->content_like(qr{Countermeasures - GOVNET</option>}, 'Queue dropdown has GOVNET countermeasures queue');
+    $m->content_unlike(qr{Countermeasures - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET countermeasures queue');
+    $m->content_unlike(qr{Countermeasures</option>}, 'Queue dropdown doesn\'t have standard countermeasures queue');
+}
+
+done_testing;

commit 028c5d3d1dec47c590b2641de472db6b8fc71dea
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Mon May 11 13:29:18 2020 -0500

    Fix test regexes for file link names

diff --git a/t/009-attachments-processing.t b/t/009-attachments-processing.t
index c8c6796d..70e7ea24 100644
--- a/t/009-attachments-processing.t
+++ b/t/009-attachments-processing.t
@@ -33,7 +33,7 @@ $agent->goto_create_rtir_ticket('Incident Reports');
     my $attachment_link = $agent->find_link(
         tag       => 'a',
         url_regex => qr/\Q$filename/,
-        text      => '',
+        text_regex => qr/\Q$filename/,
     );
     ok($attachment_link, "has link to attachment");
 
@@ -74,7 +74,7 @@ $agent->goto_create_rtir_ticket('Incident Reports');
     my @links = $agent->find_all_links(
         tag        => 'a',
         url_regex  => qr/(?:\Q$fn1\E|\Q$fn2\E)/,
-        text       => '',
+        text_regex => qr/(?:\Q$fn1\E|\Q$fn2\E)/,
     );
     is( scalar @links, 2, "has link to two attachments");
     unlink $fn1 or die "couldn't delete file '$fn1': $!";
@@ -109,7 +109,7 @@ SKIP: {
     my $attachment_link = $agent->find_link(
         tag       => 'a',
         url_regex => qr/\Q$filename/,
-        text      => '',
+        text_regex => qr/\Q$filename/,
     );
     ok(!$attachment_link, "no link to attachment");
 
@@ -187,7 +187,7 @@ $agent->goto_create_rtir_ticket('Countermeasures');
     my $attachment_link = $agent->find_link(
         tag       => 'a',
         url_regex => qr/\Q$filename/,
-        text      => '',
+        text_regex => qr/\Q$filename/,
     );
     ok($attachment_link, "has link to attachment");
 
@@ -229,7 +229,7 @@ $agent->goto_create_rtir_ticket('Countermeasures');
         my $attachment_link = $agent->find_link(
             tag       => 'a',
             url_regex => qr/\Q$filename/,
-            text      => '',
+            text_regex => qr/\Q$filename/,
         );
         ok($attachment_link, "has link to attachment");
     }

commit 3f17aed86151616fcc64d9c4c6f50c675b475c66
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri May 22 14:23:06 2020 +0800

    Limit constituency if necessary for queue select on create pages
    
    The logic is from /RTIR/Elements/CreateInRTIRQueue, which is used in the
    deprecated /RTIR/CreateInQueue.html

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 86585ab4..db27a16e 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -111,6 +111,8 @@
                 Lifecycle      => $Lifecycle,
                 ShowNullOption => 0,
                 AutoSubmit     => 1,
+                LimitToConstituency => $limit_to_constituency,
+                Constituency => $constituency,
             },
         },
         {
@@ -498,6 +500,13 @@ foreach my $id ( grep $_, @Incident ) {
 }
 @Incident = map $_->id, @IncidentObj;
 
+my $limit_to_constituency =
+    # Limit no matter what if we have a filter
+    $m->{'RTIR_ConstituencyFilter'} ||
+    # Also limit if we have a linked constituency and StrictConstituencyLinking is set
+    (RT::IR->StrictConstituencyLinking && $constituency)
+    ? 1 : 0;
+
 my $children_config = RT->Config->Get('RTIR_IncidentChildren')->{ $Type };
 
 if ( @Incident > 1 && !$children_config->{'Multiple'} ) {
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index d226e929..a4ecd5a6 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -130,7 +130,8 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
       <&|/l&>Queue</&>:
     </div>
     <div class="value col-md-9">
-      <& /RTIR/Elements/SelectRTIRQueue, Name => "Queue", Default => $queue, Lifecycle => $QueueObj->Lifecycle, AutoSubmit => 1, ShowNullOption => 0 &>
+      <& /RTIR/Elements/SelectRTIRQueue, Name => "Queue", Default => $queue, Lifecycle => $QueueObj->Lifecycle, AutoSubmit => 1, ShowNullOption => 0,
+                                         LimitToConstituency => $limit_to_constituency, Constituency => $constituency &>
     </div>
   </div>
   <div class="form-row">
@@ -364,6 +365,14 @@ for my $related_ticket ($ChildObj, $SplitObj) {
         last;
 }
 
+my $limit_to_constituency =
+    # Limit no matter what if we have a filter
+    $m->{'RTIR_ConstituencyFilter'} ||
+    # Also limit if we have a linked constituency and StrictConstituencyLinking is set
+    (RT::IR->StrictConstituencyLinking && $constituency)
+    ? 1 : 0;
+
+
 # Load the first Incident queue if none is provided
 my $queue = $ARGS{'Queue'};
 unless ( $queue ) {

commit 740736a02013297f7e8e5f3284501aaf37f9dcd6
Merge: 1ca5748a 3f17aed8
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat May 23 01:41:15 2020 +0800

    Merge branch '4.2/restore-previous-menu-2'


-----------------------------------------------------------------------


More information about the rt-commit mailing list