Forums

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

Need help using !~ operator when searching for comments using JQL

Ian _I_ - Aware October 5, 2022 edited

Hi Everyone.

I need help using the !~ operator when it comes to finding tickets via JQL based on comments.

Here is my JQL:

project in (A, B, C, D, E, F) AND status in ("Waiting for Approval", "Waiting for approval") AND resolution = Done AND comment !~ "Help Desk"

Basically, I want to show tickets that are Waiting for Approval (with resolution reason of Done) where they don't contain a comment featuring the string "Help Desk".

This is so that I know I can then add a reply to them to follow up.

However, when I run this JQL, which does run, it still shows the tickets where I have already followed up with the full comment 'Help Desk update, this ticket will be closed soon'.

Surely, they should be removed?  That is what I am trying to acheieve.

If I change the JQL to use ~ then no tickets are displayed:

project in (A, B, C, D, E, F) AND status in ("Waiting for Approval", "Waiting for approval") AND resolution = Done AND comment ~ "Help Desk"

I just read in the Atlassian docs about !~ that *If the issue contains more than 1 comment, this operator will fail, because all comments will be included in the search" - which is what seems to be happening, it fails as there are multiple comments, so how can I do what I am trying to achieve?

Sorry if this doesn't make sense, happy to answer any questions - thanks!

2 answers

0 votes
Ian _I_ - Aware October 5, 2022

Thank you for replying @Harald Seyr

I saved my filter that looked for all tickets that contained the text string (step 1 of your solution in the other thread).  But I can't do step 3, as the filter doesn't appear.

For example, I saved my filter as 'Tickets to update' but when I try to use LIKE filter not in () the filter 'Tickets to update' is not available for selection.

What am I doing wrong?

Harald Seyr
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 5, 2022

Maybe you check if the filter from first step needs to be a public filter, not privte to your user. There is some way to set access rights for each filter you save.

Ian _I_ - Aware October 6, 2022

I checked this too and the filter I made is set to My Organisation, but still doesn't show up.

Can you possibly give an example of the correct JQL syntax?

Harald Seyr
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 6, 2022

Probably something like filter not in ("Tickets to update")

You can always type the command directly without the selection, also use copy/paste.

0 votes
Harald Seyr
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 5, 2022

Hi @Ian _I_ - Aware 

maybe the solution sugessted in Solved: Searching Issues where comment field does not incl... (atlassian.com) does also help in your case.

Regards,

Harald

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
atlassian, jira service management, jsm webinar, ai in jsm, opsgenie integration, incident management, virtual agent, atlassian intelligence, ai-powered service desk, it operations, atlassian learning, service management webinar, team '25 recap

What’s new in Jira Service Management 🤔

Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.

Register here ⬇️
AUG Leaders

Atlassian Community Events