diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb
index 245a865bcba11a9aec9e273772ae8777e1c9a467..9a9b562af028ab449617e684565b04fba90e3ef5 100644
--- a/app/models/concerns/issuable.rb
+++ b/app/models/concerns/issuable.rb
@@ -145,10 +145,16 @@ module Issuable
     end
 
     def order_labels_priority(excluded_labels: [])
+      project_column =
+        case table_name
+        when Issue.table_name then "#{table_name}.project_id"
+        when MergeRequest.table_name then "#{table_name}.target_project_id"
+        end
+
       params = {
         target_type: name,
         target_column: "#{table_name}.id",
-        project_column: "#{table_name}.project_id",
+        project_column: project_column,
         excluded_labels: excluded_labels
       }