In our JIRA deployment we use several JQL functions from the excellent Script Runner plugin. But suddenly the ‘inSprint’ function stopped working, and when trying to use it you get the aforementioned error.
Turns out that the plugin has a certain bug which causes some of their functions to become unregistered in JIRA.
The solution: Disable and re-enable the plugin. Works like a charm!