Advanced text search fields with JQL

Junaid Shah
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.
April 15, 2015

Hi,

I'm wondering if it is possible in JIRA to search JIRA text fields.

e.g. a JQL query to "Text Field A" ~ "%es%"

This would return any issues containing es anywhere within that field, whether its test, estonia, compress, etc.

Thanks.

 

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Volodymyr Krupach
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.
April 15, 2015

As far as i know you can search for start of the word:

"Text Field A" ~ "es*"

and this will return only estonia.

Junaid Shah
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.
April 15, 2015

Thanks.

2 votes
Chander Inguva
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.
April 15, 2015

You can search a text value as text ~ "\"text_to_be_searched\""

To search XYZ use text ~ "\"XYZ\""

Hope this helps.

Thank You

1 vote
Udo Brand
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.
April 15, 2015

No you can't. Out of the box only * can be used, but only at the end of an string, like

"Text Field A" ~ "es*"

 all issue with a word which starts with es like estonia

But you can use scriptrunner

issueFunction in issueFieldMatch("project = ABC", "Text Field A", "es")

 That should work.

Junaid Shah
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.
April 15, 2015

Thanks.

Junaid Shah
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.
April 15, 2015

Just to confirm, the issuefunction using the script runner plugin, is run like a normal JQL query, and behaves like one too? In terms of filter, and dashboard gadget usage? Thanks.

Junaid Shah
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.
April 15, 2015

The query doesn't seem to be working as its not picking up any issues

Udo Brand
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.
April 15, 2015

Yes, it is just an extension to the normal jql. Did you set the first subquery (project = ABC) according to your needs? It was working for me.

Junaid Shah
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.
April 15, 2015

Yes I did, It seems to only work with full words

Udo Brand
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.
April 15, 2015

It found on my side issue where the only "es" was in business and yes. Maybe you need to adapt the regular expression. Do you have capital letters?

Junaid Shah
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.
April 15, 2015

I've created a test issue, with the word "test" Using this query; issueFunction in issueFieldMatch("project = TESTPROJECT", "Project Status", "es") returns 0 results but using this query; issueFunction in issueFieldMatch("project = TESTPROJECT", "Project Status", "test") Returns the test issue I had created with the word "test" in project status.

Udo Brand
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.
April 15, 2015

As I said it works for me . Used issueFunction in issueFieldMatch("project = stt", description, "estfallma") and found only issues having "Testfallmatrix" in description. I'm using scriptrunner 3.0.10 - what version are you using?

Junaid Shah
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.
April 15, 2015

Ah that's probably why.. I'm using v2.1.17

Junaid Shah
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.
April 15, 2015

So I've tested it further and have realised that the query you have given works only for JIRA's own fields, e.g. summary, description etc. but NOT custom fields that have been created.

Junaid Shah
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.
April 15, 2015

I've tested it on the summary field and it is doing as stated. searching through back and forth for those characters.

Udo Brand
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.
April 15, 2015

Hmm, custom field is also working fine on my instance.

Udo Brand
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.
April 15, 2015
Junaid Shah
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.
April 15, 2015

Possibly a bug then, I'll give it another few goes. Thanks for that Udo.

Junaid Shah
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.
April 21, 2015

Just to update, I have now upgraded my Scriptrunner to v 3.0 and the JQL query is working now.

TAGS
AUG Leaders

Atlassian Community Events