Forums

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

JQL Filter not working as expected

Oliver Jenkin August 30, 2022

Hello, hope someone can help with this.

Our service desk is split up into a couple of teams and I want to filter unassigned tickets based on the requester's email domain. 

To achieve this I have created some automation to populate a custom field with just the email domain.

I have 2 unassigned issue queues.

one that should include 2 specific email domains, JQL filter:

assignee is EMPTY AND resolution = Unresolved AND "Reporter Domain" ~ domain1.co.uk OR assignee is EMPTY AND resolution = Unresolved AND "Reporter Domain" ~ domain2.com

 

The other I want to exclude the 2 specific domains and include everything else so i have put the following:

assignee is EMPTY AND resolution = Unresolved AND "Reporter Domain" !~ domain1.co.uk OR assignee is EMPTY AND resolution = Unresolved AND "Reporter Domain" !~ domain2.com

 

The first of the queues works ok, but not the second, can anyone advise? 

 

2 answers

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
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.
August 30, 2022

I suspect this is because you have not defined the filter clearly.

When you are combining clauses in a search, you need to be precise about how you're doing it.  If you are not, Jira has no choice but to read left-to-right.

I suspect your first query only looks correct because a swathe of it is duplication, it's not working the way you think it is, but it is accidentally getting the right results.

The use of "not" usually blows that usage away, because your second filter can't accidentally get the right data when you use ! in it.

I think what you probably want is:

( assignee is EMPTY AND resolution = Unresolved ) AND ( "Reporter Domain" not in ( "domain1.co.uk", "domain2.com")  or "Reporter Domain" is empty)

Similarly, your first query should be 

( assignee is EMPTY AND resolution = Unresolved ) AND ( "Reporter Domain" in ( "domain1.co.uk", "domain2.com")  )

Oliver Jenkin August 30, 2022

Thanks for getting back to me so promptly. 

This appears to work from the preview but I get the following:

'The operator 'not in' is not supported by the 'Reporter Domain' field.'

I'm not able to save the filter.

 

The custom field i'm using is as per the workaround below from Pramodh for filtering by requester domain. 

Nic Brough -Adaptavist-
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.
August 30, 2022

Ah, ok, I'd assumed it was of a certain type.

Try

... AND  ( ( "Reporter Domain" != "domain1.co.uk" And "Reporter Domain" !=  "domain2.com")  or "Reporter Domain" is empty)

Like Oliver Jenkin likes this
Oliver Jenkin August 31, 2022

Thanks! - this has fixed it. Had to use !~ though as != also not supported.

0 votes
Pramodh M
Community Champion
August 30, 2022

@Oliver Jenkin 

Have you been following this workaround for searching the issues?

https://jira.atlassian.com/browse/JRACLOUD-61425

If its a text field it should work, let me know 

Thanks,
Pramodh

Oliver Jenkin August 30, 2022

Thanks - I have used this guide to set up the custom field to get the domain only in a field but I'm struggling to filter on the domains as described in the original post.

Suggest an answer

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

Atlassian Community Events