It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I do a case-sensitive search in Jira?

Hi,

One of our users has entered an incorrect-cased label in Jira, which is causing havoc with the filters we use, and confusion on which label is correct.  I'd like to do a case-sensitive search so I can pull up the incorrect field and change all those labels to the correct one.  This way, we can delete the incorrect label so it's not used in future. 

Basically I need to know how to search on 'tech' so I get 'tech' results and not 'Tech' results.

Can this be done?

-Jen

2 answers

1 accepted

1 vote
Answer accepted
Payne Community Leader Nov 26, 2019

If you happen to have the ScriptRunner app installed, you can do regex, and thus case-sensitive, searching, like this:

issueFunction in issueFieldMatch("labels is not empty",labels,"tech")

or, if you (or someone you work with) has access to the database, you can run the following query:

SELECT project.pkey,issuenum,label
FROM label
JOIN jiraissue on jiraissue.ID = label.issue
JOIN project on project.ID = jiraissue.project
where BINARY label = 'tech'
ORDER BY pkey,issuenum

Ah! Finally I can say thank you, Payne!  Apparently the IE browser (our work default) won't let me reply - it only allows me to mark the answer as accepted.  Switching to Chrome opens up the reply field.

It looks like we don't have ScriptRunner installed, as the search didn't work for me, but I'll see if I can get a database person to try the second option you suggested.

Thanks again for your help, and for the quick reply!

-Jen.

Hello @Payne ,

I need to use issueFieldExactMatch method in my JQL, but I need to perform case insensitive search.

Could you please help me with any regex for that

Best Regards,

Swapnil Srivastav

Payne Community Leader Dec 05, 2019

You can use the (?i) directive, like this:

issueFunction in issueFieldMatch("labels is not empty",labels,"(?i)tech")

Like SWAPNIL_SRIVASTAV likes this

Hello @Payne ,

Thanks for your reply.

It works but, I it gives match, not exact match. If we search for "tech", it will give results as "Tech", "Technology", "TECHNO", "tech"

But I want exact match i.e if we search for "tech", it should give results as "tech", "Tech", "TECH".

Could you please help me with that.

Thanks and Regards,

Swapnil Srivastav

Payne Community Leader Dec 06, 2019

\b denotes word boundary in regex, so you can surround a string with it to search for a whole word only. You'll need to use double backslashes in JQL, i.e.

issueFunction in issueFieldMatch("labels is not empty",labels,"(?i)\\btech\\b")

Hello @Payne ,

issueFunction in issueFieldMatch("labels is not empty",labels,"(?i)\\btech\\b")

does not give any results.

Using

issueFunction in issueFieldMatch("labels is not empty",labels,"(?i)\\bbtech\\b")

gives results, but that does not give exact results either.

Thanks for the response.

Best Regards,

Swapnil Srivastav

Payne Community Leader Dec 09, 2019

Hmm, I verfiy that it works exactly as expected for me. Another thought is that since you're performing a case-insensitive match, you don't need to use the regex capability offered by issueFieldMatch; just perform a normal search, like this:

labels = tech

Hello @Payne ,

JQL:

issueFunction in issueFieldMatch("project = ABC and issuetype = "DE", "Summary", "^(?i)Test$")

and for groovy:

issueFunction in issueFieldMatch("project = ABC" and key != ${issue.key}", "Summary", "^(?i)${summary}\$")

works fine for me.

Thanks a lot for your response.

Thanks and Regards,

Swapnil Srivastav

0 votes
Payne Community Leader Dec 06, 2019

Another note about using issueFieldMatch and some other ScriptRunner JQL functions - the first argument is a subquery; for performance reasons, make it as restricted as possible, so that the remainder of the function has fewer issues to scrutinize. For example, you may can limit the search to a particular project, date range, etc. like this:

issueFunction in issueFieldMatch("project = BR and created > startOfYear()",field,regex)

Hello @Payne ,

Yes, I know the fact, Thanks anyways for informing.

Best Regards,

Swapnil Srivastav

Like Payne likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you