Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,363,275
Community Members
 
Community Events
168
Community Groups

JQL Filter not working as expected

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

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")  )

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. 

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

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

0 votes
Pramodh M Community Leader Aug 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

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
Site Admin
TAGS

Atlassian Community Events