Searching in summary line to include CTM

Andrew Riley May 6, 2014

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

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 6, 2014

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

Andrew Riley May 14, 2014

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

Suggest an answer

Log in or Sign up to answer