Script Runner creating a custom JQL Function

Rudd November 6, 2014

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

2 votes
Answer accepted
Jozef Kotlár
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2014

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

Rudd November 10, 2014

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?

Like Luca Andreatta likes this
Jozef Kotlár
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 10, 2014

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

Like Luca Andreatta likes this
Rudd November 11, 2014

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
TAGS
AUG Leaders

Atlassian Community Events