Search summary having issues 5 digit number
Asked by NAREIN CM:

I would like to filter issues with 5 digit numberic followed - and one numeric value. What would be the JQL for that. e.g. 12345-1. I tried but not working


Answers:
author: Hannes Obweger - JXL for Jira
body: Hi [@NAREIN CM](/t5/user/viewprofilepage/user-id/5356851)

to the best of my knowledge, this is not possible in plain Jira/JQL.

If you're open to solutions from the Atlassian Marketplace, there's a number of apps available that either extend JQL, or provide their own, more powerful search and filter capabilities.

E.g., if you're open to solutions from the Atlassian Marketplace, your use case would be easy to solve using the app that my team and I are working on, [JXL for Jira](https://marketplace.atlassian.com/apps/1224710?hosting=datacenter&tab=overview&utm_source=atlassian-community&utm_medium=referral&utm_content=2798014).

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you'd do in e.g. Excel or Google Sheets. It also comes with a range of advanced features, including support for (configurable) *issue hierarchies* , *issue grouping* by any issue field(s), *sum-ups* , or *conditional formatting* - as well as the ability to filter issues via [*regular expressions*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions/Cheatsheet).

With regular-expression-based filtering, you can apply pretty much any logic, including the one that you are after:

![regex-filtering-2.gif](https://community.atlassian.com/t5/image/serverpage/image-id/344491iA335B0C4B63B8A48/image-size/large?v=v2&px=999 "regex-filtering-2.gif")

I'm using a custom field "Notes" here, but it would work for any other field(s) as well.

The regex that I'm using is

```
\d\d\d\d\d-\d
```

where \\d matches any digit.

Once you've identified your issues, you can work on them directly in JXL (e.g., bulk edit them via copy/paste), or trigger various operations in Jira.

Any questions just let me know,

Best,

Hannes


author: Nikola Perisic
body: Hello [@NAREIN CM](/t5/user/viewprofilepage/user-id/5356851) , you can search this for example if your issue in the summary or description have these numbers. JQL don't really have the funcionality to search based on numbers rather on text.

text \~ "12345" - this query would list all of the issues from all of the projects that contain this text.


author: Pears Whims
body: Hi [@NAREIN CM](/t5/user/viewprofilepage/user-id/5356851) ,

It looks like there have been three potential solutions provided for your issue with filtering issues based on a 5-digit number. I'm curious if any of those solutions helped you resolve the problem?

What has been your experience so far, and would you recommend any specific approach? If one of the answers solved your issue, would you consider accepting it, as it could help others who might face a similar challenge?

Looking forward to hearing your thoughts!

Best,  
Pears


author: Pears Whims
body: Hi [@NAREIN CM](/t5/user/viewprofilepage/user-id/5356851) ,

[@Nikola Perisic](/t5/user/viewprofilepage/user-id/5494176)correctly mentioned that JQL does not support regular expression, this approach is a dead end.

Yet there is an alternative solution to Your ask. If you're looking to filter issues with a 5-digit number in the issue key, you can use the following approach:

```
issuekey > EXAMPLE-9999 AND issuekey < EXAMPLE-100000
```

Since issue key support ordering with using the greater than (`>`) and less than (`<`) operators, this is why it works:

* The query filters issues where the issue key is greater than `EXAMPLE-9999` and less than `EXAMPLE-100000`.
* It will capture all issues with a 5-digit numeric value in the key (e.g., `EXAMPLE-12345`).

This approach will work for the specific projects of interest. So the method should allow you to filter out the 5-digit issues you're looking for. If you need further assistance, feel free to ask!

Best of luck!  
Pears.


author: Tim Kopperud
body: Hi [@NAREIN CM](/t5/user/viewprofilepage/user-id/5356851), you cannot search directly for a specific syntax within text field in JQL. Text fields uses fuzzy search. This article might be helpfull [Search for issues using the text field \| Jira Cloud \| Atlassian Support](https://support.atlassian.com/jira-software-cloud/docs/search-for-issues-using-the-text-field/).

A workaround might be to use Automation to set a custom field to a value if the summary contains the the number syntax. Or it can add a label (e.g. "five_numbers"). Then you can query the field or the label.

To set the field or label within Automation, you will need to analyse the Summary using [Smart Value functions](https://support.atlassian.com/cloud-automation/docs/smart-values-in-jira-automation/).

I haven't attached an example of a Smart Value function. Before I dig deeper into that and create an example of a Smart Value "code" for this, I first need to know if this workaround will work for your requirements.

TimK


Tags: cloud

jira-cloud