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:

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

2 votes
Accepted answer

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 -

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 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
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

452 views 8 26
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