diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index 1083bcec05414e3f5664f30c2d58f07362dac75c..34b6636c39f1b040ad0bbfc94e5ef3f464104e4a 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -291,8 +291,8 @@ class SystemNoteService
       notes = notes.where(noteable_id: noteable.id)
     end
 
-    gfm_reference = mentioner.gfm_reference(noteable.project)
-    notes = notes.where(note: cross_reference_note_content(gfm_reference))
+    gfm_reference = mentioner.gfm_reference(nil)
+    notes = notes.where('note LIKE ?', "#{cross_reference_note_prefix}%#{gfm_reference}")
 
     notes.count > 0
   end
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb
index d3364a71022c9d953c59971ad4570dfeea2066b3..a3d3147a79b78aef45b7fb3f1127aec188fccdb4 100644
--- a/spec/services/system_note_service_spec.rb
+++ b/spec/services/system_note_service_spec.rb
@@ -424,6 +424,22 @@ describe SystemNoteService, services: true do
           to be_falsey
       end
     end
+
+    context 'commit from fork' do
+      let(:author2) { create(:user) }
+      let(:forked_project) { Projects::ForkService.new(project, author2).execute }
+      let(:service) { CreateCommitBuildsService.new }
+      let(:commit2) { forked_project.commit }
+
+      before do
+        described_class.cross_reference(commit0, commit2, author2)
+      end
+
+      it 'is falsey when is a fork mentioning an external issue' do
+        expect(described_class.cross_reference_exists?(commit0, commit2)).
+            to be_falsey
+      end
+    end
   end
 
   include JiraServiceHelper