Clash with hasAttachments, hasSubtasks and hasLinks functions

Problem

When trying to use a JQL function provided by ScriptRunner, it doesn't work and an error message similar to the following appears:

Uncaught exception thrown by REST service: No signature of method: com.jtricks.function.links.HasLinksFunction.getQuery() is applicable for argument types: (com.atlassian.jira.jql.query.QueryCreationContextImpl, com.atlassian.query.operand.FunctionOperand, com.atlassian.query.clause.TerminalClauseImpl) values: [com.atlassian.jira.jql.query.QueryCreationContextImpl@1af4283a, ...]

The precise package and class of the getQuery method may vary but importantly the package will not be within ScriptRunner's namespace (com.onresolve...)

Solution

There are various Jira add-ons (e.g. JQL Tricks, JQL Booster Pack) which provide JQL functions with the same names as ScriptRunner JQL functions. If one of these add-ons is installed alongside ScriptRunner for Jira, the same-named functions can clash, resulting in errors of the kind shown above.

The best workaround is to disable the clashing module from one of the add-ons (i.e. either ScriptRunner or JQL Tricks/JQL Booster Pack/etc.)

You can disable the JQL Tricks hasAttachments module:
  • Go to JIRA Admin (cog icon)
  • Manage Add-ons
  • Choose the 64 of 64 modules enabled link

  • Disable the clashing Add-on module