You can also use the Craftforge JQL Functions Plugin, which can do this and is free. You just need to use "issue in/not in linkedIssuesFromQuery("JQL query")" or "linkedIssuesFromFilter("filter name or its id")" function of the plugin (and the derivations of these functions).
With jql, you can only search for a particular issue with links using linkedIssues().
Syntax
linkedIssues(issueKey)
linkedIssues(issueKey,linkType)
There is a commercial plugin available that can do this - the JQL Tricks plugin
It installs a bunch of new JQL functions, including one called hasLinks.
Even better! :-)
It looks like you're new here. Sign in or register to get started.