How can I count tickets with labels matching a pattern?

Jeff French March 25, 2024

We add a label to support tickets that indicate the type/cause. All of them start with the same prefix. In a dashboard I'd like to show the count of tickets with each label with that prefix, but ignore the rest.

For example, using the "two dimensional filter statistics" gadget and a script runner function, this query:

issueFunction in issueFieldMatch("project = PROJ AND component = support'", labels, "support_*") AND updatedDate > startOfDay(-30d)

will find the tickets with a support_* label, but also all the other labels in addition to it.

Is there any way to display counts for just the support_* tickets?

2 answers

1 accepted

0 votes
Answer accepted
Kalyan Sattaluri
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.
March 25, 2024

Hello @Jeff French 

If I understand your ask, you want, in your gadget, to only show certain labels of pattern "support_" and not show other labels even though they exist.

if so, OOTB, I dont think you can filter out certain values from that gadget. Also, I dont think labels is the right place for it if you want to run such a report.

One option is to look into third party add-ons like Rich Filters which lets you add additional JQL clauses inside a gadget to limit result set, or create custom columns...That could *potentially* solve it.

 Another option would be to use automation to copy over this interested label to new field and start using that field go forward for new issues as well. One time clean up / set up of the rule but it will be available go forward..

Those are some of the options I can think of.

OTOH, if I misunderstood the ask and  you want to query issues where the only label is "support_*" pattern and should not have any other label, that can be achieved, but I dont think thats the ask.. right?

Jeff French April 4, 2024

You understood my ask correctly, Kalyan. I think for this problem we'll use another field like you suggested. Then we'll have more control over the content.

Like Kalyan Sattaluri likes this
1 vote
Hannes Obweger - JXL for Jira
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 26, 2024

Hi @Jeff French

if you're open to solutions from the Atlassian Marketplace, you may want to have a look at the app that my team and I are working on, JXL for Jira.

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 number of advanced features, including support for (configurable) issue hierarchies, issue grouping by any issue field(s), sum-ups, or conditional formatting

With these, you can build a view like e.g. this in just a couple of clicks:


This is really just one of a virtually endless number of possible views and reports - you can also filter and group by any other field(s), configure different sum-up styles, etc. etc.

Any questions just let me know,



Jeff French April 4, 2024

Thanks, Hannes. This is a lot for my specific problem, but it looks real interesting in general. It would help the program managers I work with. I'll pass this on to them.

Suggest an answer

Log in or Sign up to answer