Scripted JQL Function failed to load/compile

After upgrading to JIRA 6.3.1 and Script Runner 3.0.1, our scripted JQL functions are failing to load.

We've reviewed the document on breaking changes in 3.0 and attempted to migrate the scripts. After scanning, a tooltip/popup says no additional scripts are added, and in the atlassian-jira.log we see an entry that the script file(s) 'failed to load/compile' with no additional detail.

As a test, we tried to create a function that does only returns null following the example provided (ABC.groovy), with no change.

Is there any undocumented gotches to the new format, or anything we can do to improve the debugging information on WHY it failed to load?

Any ideas would be appreciated, thanks.

package com.onresolve.jira.groovy.jql

import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.jql.query.QueryCreationContext
import com.atlassian.jira.util.MessageSet
import com.atlassian.query.clause.TerminalClause
import com.atlassian.query.operand.FunctionOperand

class JQLTEST extends AbstractScriptedJqlFunction implements JqlQueryFunction{
	String getDescription() {
		"test JQL function"
	List<Map> getArguments() {
	String getFunctionName() {
	def String subquery
	MessageSet validate(User user, FunctionOperand operand, TerminalClause terminalClause) {
	Query getQuery(QueryCreationContext queryCreationContext, FunctionOperand operand, TerminalClause terminalClause) {

1 answer

1 accepted

First of all it's good that you are trying a stubbed class.

It's no good that the compilation error is not shown, I raised

I tried the class you posted and it compiled and was added. Have you tried with that exact class? Is it in the correct directory under your script root? eg


Thanks Jamie. The text was an exact copy/paste of the contents of the file, I believe it is in the location you refer to. Here's the later part of the one entry we do get in the log file for that particular test script:

C:\Program Files\Atlassian\Application Data\JIRA\scripts\com\onresolve\jira\groovy\jql\JQLTEST.groovy failed to load/compile

We also added a different location to the scripts path as you described in the documentation, so we've tried a few different files in both locations. For both locations, once the directory structure (\com\onres...) was created and the file(s) placed in the lowest directory we see a line for each file as above, but always failed to load/compile. Other JQL function script files in the root rather then down the line in ..\jql do not show in the log in this way.

I took that to mean our issue is with the content of the file, and not the location, but I'll be happy if it's simple user error on file name or location!

Robert, can you install the snapshot of the next release version from

This should tell you why the function is failing to load.

That was the key, thanks so much.

I suspect that it didn't like the space in Program Files. Once I had that clue, I created a new scriptroot with no spaces, and the illegal charecter went away and started giving me really meaningful errors in the log that I could trace down. I got the test recognized quickly have now have two of our original custom JQLs in.

Since I had the some when I tried putting the files in the scriptroot the plugin creates (JIRA_HOME\scripts), I'm not sure if there is something you can address or at least put a comment in the docs that this could be an issue.

2014-07-28 08:58:15,622 Thread-43 WARN xxxxxxx 537x119x2 z0zkay /rest/plugins/1.0/ [onresolve.scriptrunner.runner.ScriptRunnerImpl] Script C:\Program Files\Atlassian\Application Data\JIRA\scripts\com\onresolve\jira\groovy\jql\plugins\JQLTEST.groovy failed to load/compile: Illegal character in path at index 16: file:/C:/Program Files/Atlassian/Application Data/JIRA/scripts/com/onresolve/jira/groovy/jql/plugins/JQLTEST.groovy

Thanks again!

Great, thanks. Did you try with the snapshot version, and that then gave you the clue about the space? Or it didn't warn you about that?

I raised the issue with spaces, but have not tried to reproduce yet.

With the release version, all we were getting was the basic "...<file> failed to load/compile".

Once I loaded the snapshot version you provided, the logging started adding the illegal charecter message I mentioned previously.

Based on that I started moving files to the alternate scriptroot, and the illegal charecter message went away for the moved file and I started seeing errors about the content (basically issues with our code) instead and relatively easy to debug with the error messages provided.

We're still working through some coding issues, making sure we understand the new format, but we do have two basic jqlfunctions in place and working so we're heading down the right path.

Thanks again!

Brilliant, thanks. The change I made for the snapshot is in the version released last night, 3.0.2.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

905 views 3 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you