JQL / Labels field / Isolating customer

Jeff Murray March 20, 2024

Hello -

I created this JQL however, I'm stuck. In the labels field there are other words besides CUST_customer name. I only want to see the CUST_customer name.

project = SF AND issuetype in (Bug, Story, Task) AND status = Done AND "Epic Link" = SF-423 AND labels "~" "CUST_*"

How do I correct this?

Thanks, Jeff

3 answers

2 accepted

0 votes
Answer accepted
Matt Doar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2024

I recommend using a select list field not Labels for this. The Labels field searcher returns an issue and all its labels if any of the labels match the given string.

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2024

Hello @Jeff Murray 

I'm not sure that I understand what you are trying to accomplish.

Can you provide samples of issues with a variety of Labels values and indicate which ones you would want to see in your results?

i.e.

Issue key  Values in Labels field  In Results? 
ABC-123  CUST_1234 
ABC-456  CUST_1234, Another_Label, And_another_label Y (or N?) 
ABC-789 Another_Label  N

 

Jeff Murray March 20, 2024

Hi Trudy -

 

In your example, yes to the first one, no to the second and no to the third just like you have outlined.

Thanks,

Jeff

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2024

Here is one more case to consider:

Issue Key  Values in Labels field  In Results? 
ABC-2345  CUST_1234, CUST_ABCDE   

 

Jeff Murray March 21, 2024

Trudy -

In that case, we want all of those starting with CUST_

 

Thanks,

Jeff

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2024

Let me state what I think your requirement is. Correct me if I am wrong.

You want to retrieve issues that have Labels values where all the Labels values start with "CUST_".

  • If the issue has Labels values that don't match that, then the issue is not included in the results. Example: an issue with Labels values CUST_1234 and Another_Label_value is excluded because it has a Labels value that doesn't match the pattern.

If that is an accurate description of your requirement, then it is not easily possible to do that with native JQL capabilities. You would have to include clauses in your JQL to actively exclude issues that had any other label.

I found an old discussion on this topic that might be useful to you.

https://community.atlassian.com/t5/Jira-Software-questions/Filter-issues-that-have-only-one-specific-label-and-no-other/qaq-p/670819

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
March 22, 2024

Hi @Jeff Murray

if you're open to solutions from the Atlassian Marketplace, this would be easy to do using 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 hierarchiesissue grouping by any issue field(s), sum-ups, or conditional formatting - as well as the ability to filter issues via regular expressions

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

regex-filtering-labels.gif

The regex that I'm using is

^CUST_\w+(, CUST_\w+)*$

There's a few things going on here, but TLDR, it checks if CUST_<something> occurs one or more times, with no other text in between or around.

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.

Hope this helps,

Best,

Hannes

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events