Fix hooks for web based events with external issue references
The creation of cross references for external issues (which would fail)
is now prevented. This fixes a 500 error and the execution of hooks when
creating a merge request or commenting on one.
Fixes#1650, GH-9333.
This regression might have been introduced by
8f8a8ab32b. There is actually a TODO by
@rspeicher mentioning external issues which is lost (unhandled) in a
later commit.
This fix is related to !766 and !804 which fix a similar issue for hooks for
Git based events.
See merge request !794