Skip to main content
4-Participant
November 16, 2018
Solved

Having an issue with Project which contains parentheses and cli

  • November 16, 2018
  • 1 reply
  • 2159 views

So I have a project which has parenthesis in it, and I am trying to execute a query from the command line constructed from a query definition.

 

Here is a Query defined which  has the same query definition:

Name: frl-Test
...

Query Definition: ((field["Summary"] contains "#29") and (field["Type"] = "Sprint") and (field["Project"] = "/Electronic Tools (ETPL)/Foobar"))
Sorted By: ID (Ascending)
Fields: ID,Type,Summary,State,Assigned User,Project

 

Here is the issue I receive when I enter the query defined for the issues cli interface.

im issues --queryDefinition="((field[Summary] contains ""#29"") and (field[Type] = ""Sprint"") and (field[Project] = ""/Electronic Tools (ETPL)/Foobar""))"
*** MKS124814: Cannot show view information: A "(" was found within a ( ) group. Error occured before "ETPL)/Guidanz))"

 

I have tried escaping the parentheses with a backquote (`), and this did not help the situation. Can I just not have a parentheses in the name?

Best answer by awalsh

The trick is to use single quotes around the entire query definition and double quotes for the field names and values.  For example:

 

im issues --queryDefinition='((field[Type]="Work Item") and (field[Project]="/My (Test) Project"))'

This is also documented in article 171843.

 

1 reply

awalsh5-Regular MemberAnswer
5-Regular Member
November 16, 2018

The trick is to use single quotes around the entire query definition and double quotes for the field names and values.  For example:

 

im issues --queryDefinition='((field[Type]="Work Item") and (field[Project]="/My (Test) Project"))'

This is also documented in article 171843.