If when running a query similar to below you get an error stating that the hasLinks() function cannot be found.
This is because inside of ScriptRunner for Jira Cloud the hasLinks function is a JQL keyword as described in the documentation page http://scriptrunner-docs.connect.adaptavist.com/jiracloud/jql-aliases.html#_haslinks.
As it is a JQL Alias you do not provide the issueFunction in part of it and the documentation page above shows how to run a query using the hasLinks JQL Alias inside of Jira Cloud.
An exampe of how to use the hasLinks function is shown below for reference purposes.
We can also confirm that you can see more detailed information on the differences between the cloud and server versions inside of our documentation page located here .
Please note JQL keywords need to be synchronised to be used before they will return results inside of Jira Cloud so if you do not see any results using the hasLinks keyword then you should follow the steps in the knowledge base article located here to synchronise the JQL keywords inside of your instance.