Filter components with JQL

Matti Popesku February 16, 2014

Hi there,

I want to query based on components matching with some string?

For example "component !~ 'string abc'" doesn't work for component.
And I want to use wildcards like "component !~ 'string *'"

Wich operators schould I use for "component DOES NOT CONTAIN 'string *'"? Are there other operators?

I'm using JIRA 6.0.3

2 answers

5 votes
Udo Brand
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.
February 16, 2014

The only operators you can use for component are =, !=, in , not in ,is and is not. So no chance out of the box.

Maybe you could use script runner plugin which has an additional JQL function

component in componentMatch("string.*")
Alexander Richter
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.
July 18, 2016

i want to search for issues that have ONLY a certain component.

  1. no component -> issue is not in filter
  2. component is MBA and DV -> issue is not in filter
  3. component is MBA -> issue is in filter

is there a possibility to do that with a regex expression?

Like Samantha Birkinshaw likes this
Nathaniel Irons April 30, 2018

Long after the fact, this looks like it has the intended effect:

component in (MBA) AND component not in (DV)
Andy Strickland January 21, 2021

I tried several solutions for this myself before I came to one that worked for me.

(component is EMPTY OR component not in ("componentName"))

I wanted to show any component, even if the component is empty. Because of the architecture, the component field does not exist until a component is added to the issue. Therefore, component != or something like this will not work, because the component field does not exist and cannot be parsed, so it will return an empty issue list.

Also, just slamming an OR into your existing JQL will break the rest of your filter, so you have to wrap the whole thing in parenthesis.

Hope this helps someone.

0 votes
Filipe February 25, 2014

Hi,

Try if

https://marketplace.atlassian.com/plugins/pt.lt.lfcribeiro.jira.jqlLTFunctions

Solves your problem, nevertheless it will let you run SQL functions using executeQuery()

Regards,

Suggest an answer

Log in or Sign up to answer