diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb
index a7f515ac851d5f1745090fed901b0980aca151a3..4b6e22e3607b7fa59cb348b652f4ab4dfbebcb8d 100644
--- a/app/controllers/projects/issues_controller.rb
+++ b/app/controllers/projects/issues_controller.rb
@@ -91,7 +91,7 @@ class Projects::IssuesController < Projects::ApplicationController
   protected
 
   def issue
-    @issue ||= @project.issues.find(params[:id])
+    @issue ||= @project.issues.find_by_iid!(params[:id])
   end
 
   def authorize_modify_issue!
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index d135cf05b9ed70d98933b6f42e1045c2d0965c85..235247f3e523e28cc11d613a43e0686bb7399a20 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -132,7 +132,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
   end
 
   def merge_request
-    @merge_request ||= @project.merge_requests.find(params[:id])
+    @merge_request ||= @project.merge_requests.find_by_iid!(params[:id])
   end
 
   def authorize_modify_merge_request!
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 9e88d0b4757511acfd1ed67d3e131e5012640962..9b4fe5a9b5bda321a8fcbebad29b01f5eeb2b8b2 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -104,7 +104,7 @@ class ProjectsController < Projects::ApplicationController
   def autocomplete_sources
     @suggestions = {
       emojis: Emoji.names,
-      issues: @project.issues.select([:id, :title, :description]),
+      issues: @project.issues.select([:iid, :title, :description]),
       members: @project.team.members.sort_by(&:username).map { |user| { username: user.username, name: user.name } }
     }