Searching in summary line to include CTM

Hi Everyone

I am trying to search for all issues associated to specific projects within specific parameters. This is the search and works fine at the moment.

Search 1

project in (LVONE, LVTWO, INF, ITS, LVTHREE) AND status in (Resolved, Closed) AND reporter in (membersOf(jira-ctm)) AND resolved >= 2013-04-01 AND resolved <= 2014-05-30 ORDER BY key ASC, updated DESC

Where I am having problems however is that I want to search for all issues still in these projects but that include 'CTM' in the summary line but the reporters could not be members of the jira-ctm group. It's almost like I am trying to put two searches into one.

If I try AND Summary ~ "CTM" in different parts these are the results.

Search 1, 607 issues

Search 2, 126 issues

project in (LVONE, LVTWO, INF, ITS, LVTHREE) AND Summary ~ "CTM" AND status in (Resolved, Closed) AND reporter in (membersOf(jira-ctm)) AND resolved >= 2013-04-01 AND resolved <= 2014-05-30 ORDER BY key ASC, updated DESC

Search 3, 60976

project in (LVONE, LVTWO, INF, ITS, LVTHREE) OR Summary ~ "CTM" AND status in (Resolved, Closed) AND reporter in (membersOf(jira-ctm)) AND resolved >= 2013-04-01 AND resolved <= 2014-05-30 ORDER BY key ASC, updated DESC

Search 4, 1947

project in (LVONE, LVTWO, INF, ITS, LVTHREE) AND status in (Resolved, Closed) AND reporter in (membersOf(jira-ctm)) OR Summary ~ "CTM" AND resolved >= 2013-04-01 AND resolved <= 2014-05-30 ORDER BY key ASC, updated DESC

I think the actual result should be somewhere between the results of search 1 and 4.

Any help would be greatly appreciated.

Thanks, Andrew

1 answer

This widget could not be displayed.

This is a classic example of humans thinking in human speak and actually being quite fuzzy about their searches - you know what you mean, and when you say it out loud, you're unconsciouly emphasising and punctuating what you're saying in a way that makes it perfectly clear to another human. But a computer needs absolute clarity, and it probably doesn't help that the rules on how "and" and "or" work in a query are as clear as mud to us.

I usually find it best to think in clauses and then do a complete-overkill approach to it with probably far too many braces to make sure the and/or stuff does exactly what I want.

So, from "all issues still in these projects but that include 'CTM' in the summary line but the reporters could not be members of the jira-ctm group"

This bit is clearly right:

project in (LVONE, LVTWO, INF, ITS, LVTHREE) AND Summary ~ "CTM"

Then I think you need

reporter NOT in (membersOf(jira-ctm))

Then, I think the "still" in your question probably refers to the status, so

AND status in (Resolved, Closed)

And to combine those clearly, try

(project in (LVONE, LVTWO, INF, ITS, LVTHREE) AND Summary ~ "CTM" ) AND (reporter NOT in (membersOf(jira-ctm)) ) AND (AND status in (Resolved, Closed) )

In other words, I've landed with your query 2, with more brackets and a NOT statement. The brackets will help if you decided to start compounding your query more - you don't need them if every clause is going to be joined with AND

Thanks Nic. Greatly appreciate your explanation here. I'll give it a try.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

536 views 23 15
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you