Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL providing "has no other component assigned than B"

Ralf Fahney October 29, 2025

Hi everyone,

I have components A, B, C

I have tickets

  • XYZ-1 components A, B
  • XYZ-2 components B
  • XYZ-3 components B, C
  • XYZ-4 components A, C
  • XYZ-5 components EMPTY

I need a JQL excluding XYZ-2 by "has no other component assigned than B". The result set of that JQL shall be

  • XYZ-1
  • XYZ-3
  • XYZ-4
  • XYZ-5

The solution suggested by I want to do a JQL query with "all except for" doesn't help as the result set will be

  • XYZ-4
  • XYZ-5

XYZ-1 and XYZ-3 will not be provided

I don't want to do a query like "EMPTY or in (A, C)" as I don't want to extend the query whenever a new component gets defined

What suggestions do you have to solve this problem?

3 answers

2 accepted

1 vote
Answer accepted
Rik de Valk
Community Champion
October 29, 2025

Hi @Ralf Fahney ,

I don’t think there’s a direct JQL solution for that. 
But what you could consider is to create a custom number field ‘Number of Components’ and create an Automation Rule that triggers whenever the field Components changes and counts the component and sets the custom field to the result.

Once that is set and implemented you can query on Component = B and ‘Number of Components’ = 1

Hope that helps. Have a nice day! Rik

0 votes
Answer accepted
Bill Sheboy
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.
October 29, 2025

Hi @Ralf Fahney 

Short answer: I do not believe that is possible with out-of-the-box JQL features.

JQL is not a SQL, and does not have some features that might help do this.  And, there is no built-in list counting feature for fields like Components.  For workarounds, they depend upon how often you need this type of query:

  • One-time need
    • Export the work items and perform the check in a spreadsheet
  • Need more frequently
    • Investigate marketplace apps which add features to JQL
    • Depending upon your license level, use an automation rule to count the values in the Component field, saving the result in a custom field...then use built-in JQL functions to check the count and field value.  Jira license level may impact this due to the amount of rule usage.

Kind regards,
Bill

0 votes
Ralf Fahney October 29, 2025

@Rik de Valk  @Bill Sheboy Thanks for your suggestions. The query will be part of a Kanban board filter. We'll use it daily. You both suggested the counting approach. I'll try that

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events