Script Runner creating a custom JQL Function

Hi - we are having trouble getting our custom JQL Function to appear/work in Jira.  Using JIRA 6.2.7 and Script Runner 3.0.1.   According to this:

https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+JQL+Functions#ScriptedJQLFunctions-Writingyourownfunctions

There is a template, which we are not getting.  We see the list of existing functions, but no button to "Add New Function".  We do see a link where we can scan for recently added ones.  But we are unsure of where to put our custom script in order for the Scan link to actually find it.

Any assistance is appreciated.

1 answer

1 accepted

Online editing of JQL functions is not provided in 3.0 anymore - see Breaking Changes for+Custom+JQL Functions in 3.0.

hi - yes, i've seen that link.  I guess the part I am missing is from this statement:  "So the UI has been dropped in favour of just scanning your script roots for jql functions. If you create a new groovy file containing a JQL function under a script root, go to Admin -> Script Functions, and click the scan link (or you can restart jira). "

where do I find the default script root?  Or if we've created our own, where is this configured?  

Also, is there still a template file to use as a starting point?

Scripts root is usually {{$JIRA_HOME/scripts}}, so your JQL function should be placed in {{$JIRA_HOME/scripts/com/onresolve/jira.groovy/jql}} - as described in Template implementation is mentioned some lines below - https://gist.github.com/jechlin/11153983

Finally! I got it to recognize my script. The IntelJ setup instructions are a bit out of date (and confusing - I've never used IntelJ before). It wasn't finding the groovyrunner.jar file (had to go back and add the top level $JIRA_HOME to the list of directories). Once past that, and created new directory $JIRA_HOME/scripts/com/onresolve/jira/groovy/jql for my script, I ran into https://jamieechlin.atlassian.net/browse/GRV-524. Which was easily fixed by renaming my class to match my script name. Thanks for the help!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

181 views 0 4
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