Dear Atlassian Community,
I'm trying to build a custom JQL function with scriptrunner.
We have a text field which contains IDs from thousands of issues. I need to check if this ID matches the numerical portion of the issue key.
An example:
issue key: ABC-123
myCustomField: ABC_00123
So I need to match issue.number with the part after _00 in the customfield.
I already have a working custom JQL function by implementing JqlValuesFunction.
But it is very slow so I want to do it with Lucence by implementing JqlQueryFunction.
Here is the queryBuilder part of my code:
def queryBuilder = JqlQueryBuilder.newBuilder()
def whereClause = queryBuilder
.where()
.customField(remedyIdCF.idAsLong)
.like(<issue.number>)
.endWhere()
.buildQuery()
.whereClause
But how can I reference the issue.number (or issue.key) from in a querybuilder?
And how can I use just a portion of myCustomField to perform the match?
There are not many examples available on the web and
javadoc is not so straight forward.
Any help or pointers are appreciated!