How can I search for more than one word using the "contains" operator?

Bruno Borges September 12, 2019

Hello !

Assuming I need to search a list of different words without having to repeat the query as in the example below:

 

project in (URA) and createddate> = startOfMonth () and status not in (closed, resolved, canceled) and issuetype in (incident, Request) and "Customer Request Type" is not EMPTY and summary ~ "sounds" or project in ( IVR) and createddate> = startOfMonth () and status not in (closed, resolved, canceled) and issuetype in (incident, Request) and "Customer Request Type" is not EMPTY and summary ~ "test"

 

I have to bring an extensive list of results, but I am already exceeding the amount of characters.

 

What can I do?

2 answers

1 accepted

0 votes
Answer accepted
Ste
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 12, 2019

Hi @Bruno Borges

Looking at your query, it looks like the common parameters are:

project in (URA) and createddate> = startOfMonth () and status not in (closed, resolved, canceled) and issuetype in (incident, Request) and "Customer Request Type" is not EMPTY

A few pro-tips on this first:

  • You can group the projects - for example "project in (URA, IVR)"
  • If all the statuses are your "Done" statuses - you could replace the "status not in" part with either "statusCategory != Done" or "resolution is empty" to see open issues. Future proofs you in case more Done statuses are added.

I can think of two methods to make a search for a number of keywords as part of this. The first is to use the OR statement for the keywords. You can surround the keyword queries in brackets to show each word searched for should be considered against the rest of the common parameters - for example:

project in (URA) and createddate> = startOfMonth() and status not in (closed, resolved, canceled) and issuetype in (incident, Request) and "Customer Request Type" is not EMPTY and (summary ~ "sounds" OR summary ~ "test" OR summary ~ "design")

^ This should give you what you need. An alternative - which is useful if you have a large number of keywords or a list which regularly changes - is to save it as a separate filter and search for issues which match it. This stops the query becoming too long due to one parameter - for example, create a filter like this:

summary ~ "sounds" or summary ~ "test" or summary ~ "design" or summary ~ "front-end" or summary ~ "back-end" or summary ~ "QA" or summary ~ "website

Save this filter and in the URL bar it will be given an ID - usually this is a few numbers at the end of the equals sign. You can then build a query like this:

project in (URA) and createddate> = startOfMonth() and status not in (closed, resolved, canceled) and issuetype in (incident, Request) and "Customer Request Type" is not EMPTY and filter = XXXXX

^ This decouples the larger parameter and means you can add or remove words from its filter, and it'll change your main results set to suit.

Ste

0 votes
Bruno Borges September 13, 2019

Hello @Ste 

 

It worked, thanks for the help.

 

Best regards.

Suggest an answer

Log in or Sign up to answer